StudyToCert

All certifications / OCP Java / Lessons

Oracle Certified Professional: Java SE Developer 1Z0-831 (Java SE 25) · Domain 9: Using the Java I/O API

Path creation and operations: resolve, relativize, normalize, getFileName, getParent

▶ Watch the overview video

Last reviewed September 25, 2026 · Leer en español

The NIO.2 API in java.nio.file represents a location in a file system with the Path interface. You create one with Path.of("data", "logs", "app.log") or the older equivalent Paths.get(...). Creating a Path does not touch the disk: the file does not need to exist, and most Path methods are pure string manipulation. An absolute path starts from a root, such as / on Linux or C:\ on Windows; a relative path is interpreted against the current working directory.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 5 more sections, 5 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study OCP Java for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the OCP Java study plan