Question
Which statement about NIO Files and Path is the strongest interview answer?
- NIO Files and Path is mostly a naming style choice and has little effect on runtime or design.
- NIO Files and Path exists mainly to reduce the number of Java files in a project.
- Path and Files provide a modern, consistent API for filesystem paths and file operations.
- NIO Files and Path matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind NIO Files and Path.
Answer and rationale
Correct answer: C. Path and Files provide a modern, consistent API for filesystem paths and file operations.
Path and Files provide a modern, consistent API for filesystem paths and file operations. This is the base concept interviewers commonly test first.
Track: Java