Loading…
Loading…
Ten exam-style questions on NIO.2 Path methods: immutability, getNameCount, getName and subpath, getParent and getRoot, resolve, relativize, normalize, toRealPath, startsWith, option enums and creating directories, with explanations.
Practice questions for the article Java Path Methods: normalize, resolve, relativize and Files Basics.
All paths are Unix-style, as on the exam. Every output was checked against a real JDK. Aim for at least 8 out of 10.
Quiz path: step 98. Take the quizzes in this order, after reading each article.
Previous quiz: File and Path (OCP 21)
Next quiz: Copying, Moving, Deleting and Comparing Files (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.