Question
In Java, which comparison about NIO Files and Path is accurate?
- There is no practical difference in behavior, performance, or API design when NIO Files and Path is involved.
- The oldest option related to NIO Files and Path is always the right production choice regardless of context.
- Differences around NIO Files and Path are mostly cosmetic, so correctness and maintainability do not change.
- Path models filesystem locations more cleanly than the older File API, especially across different platforms.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: D. Path models filesystem locations more cleanly than the older File API, especially across different platforms.
Path models filesystem locations more cleanly than the older File API, especially across different platforms. This is the comparison that usually separates memorization from understanding.
Track: Java