What happens?
void main() { Path p = Path.of("a/b/c/d"); Path s = p.subpath(1, 3); IO.println(s.getNameCount() + " " + s.getFileName());}50 questions · 90 minutes · 68% to pass Format from secondary sources: check it on education.oracle.com before you book.
Exam 1Z0-829 · Java SE 17 Developer
The OCP 17 syllabus is split into short drills, one rule each: 1,293 so far. Answer one, see what JDK 17 did, and it comes back just before you'd forget it. You learn by recalling each rule, not by rereading a book.
1,293 drills · 11 domains · 94 topics · every code answer run on JDK 17
Press 1 to 3 to choose an answer
void main() { Path p = Path.of("a/b/c/d"); Path s = p.subpath(1, 3); IO.println(s.getNameCount() + " " + s.getFileName());}Each drill tests one rule, so a miss tells you exactly what to fix.
Compile errors, exceptions, and output are captured from real runs.
Missed drills come back sooner. The ones you know come back less often.
A study guide explains a topic like this one once, in a few pages. Here it becomes 19 short drills on 14 rules, each answered in seconds and each brought back on its own schedule. Below are 6 of them, with what JDK 17 did.
Every topic has one, written for the drills it supports. It opens with the main idea, the line to remember, the traps, and a diagram. The rest is one click away. This one covers the topic of the drills above.
A Path is an immutable, purely syntactic list of name elements (plus an optional root); almost all Path methods just manipulate that list and never touch the disk.
Remember Path = list of names. Only toRealPath looks at the disk.
subpath(1, 5) on a 4-element path and getName(3) on a 3-element path throw IllegalArgumentException.getFileName() of a/b/.. is .. — nothing is normalized automatically.normalize() keeps a leading ...resolve with an absolute argument ignores the receiver.toRealPath() needs the file to exist; toAbsolutePath() does not.Path.of("abc/def").startsWith("ab") is false.| Method | Example | Result | Touches disk? |
|---|---|---|---|
getFileName() | a/b/c | c | |
getParent() | a/b/c · c | a/b · null | |
getRoot() | a/b | null | |
getName(1) | a/b/c | b (index 3 → IAE) | |
subpath(1,3) | a/b/c/d | b/c (end exclusive) | |
normalize() | a/./b/../c · ../x/./y | a/c · ../x/y | |
resolve(q) | a/b + c · + /abs | a/b/c · /abs | |
resolveSibling(q) | a/b/c.txt + d.txt | a/b/d.txt | |
relativize(q) | a/b → a/c/d | ../c/d (mixed kinds → IAE) | |
toAbsolutePath() | a/b | cwd + a/b | |
toRealPath() | missing file | NoSuchFileException |
The OCP 17 syllabus is long. A study guide covers it once, in prose. A full mock exam tests it all at once: each question mixes several traps and topics, and one sitting takes about two hours. Learn here first, one rule at a time, then rehearse under exam conditions.
Short daily sessions. Each drill tests one rule, shows what the JVM did, and comes back just before you'd forget it.
Recall per domain shows which objectives you still miss, so you study those instead of rereading everything.
Full timed mock exams: long code, mixed traps, the clock. Enthuware is built for this. The few mock exams here check your timing. They don't replace a full bank.
| Study guide | Short drills, here | Full mock exam | |
|---|---|---|---|
| One sitting | A chapter | As long as you have: stop after any drill | 50 questions in 90 minutes Format from secondary sources: check it on education.oracle.com before you book. |
| Rules per question | Many, explained in prose | One | Several, across topics |
| When you find out you were wrong | When you test yourself | Right after you answer, with the JVM output | After you submit the whole exam |
| When it comes back | When you reread it | Just before you'd forget it | On your next mock exam |
| Best for | A first complete pass over the syllabus | Learning each rule until it sticks | Rehearsing the exam before you book it |
11 domains, each with its own drills, recap, and review schedule. Pick one to see what it covers.
Domain 1
Handling date, time, text, numeric and boolean values
17 topics in OCP 17
Readiness is your predicted recall on each OCP 17 domain, not a single opaque score. Book the exam when every bar passes your target.
Switching exams? Drills whose outcome changes between Java 17, 21, and 25 are marked as version traps. Pick a JDK to see what it did with this one.
enum Light { RED, AMBER, GREEN }void main() { Light l = Light.GREEN; String action = switch (l) { case Light.RED -> "stop"; case AMBER, GREEN -> "go"; }; IO.println(action);}Run on JDK 17
$ java Main.javaMain.java:5: error: an enum switch case label must be the unqualified name of an enumeration constant case Light.RED -> "stop"; ^error: compilation failed
50 questions · 90 minutes · 68% to pass. Once you've learned the rules, use them to check your timing and find the domains that still cost you points. They don't replace a full mock-exam bank for rehearsal.
Format from secondary sources: check it on education.oracle.com before you book.
Prices in euros, VAT included. One pass covers every Java OCP exam: OCP 17, 21, and 25.
€0
About 15% of each exam's drills, with the proof and the review schedule.
Start free€24 for 120 days
Every drill, recap and mock exam for the Java OCP exams.
Get the practice pass€39 for 120 days
The full course, lesson by lesson, plus the practice pass.
Get the course€99 per year
Every certification as it launches, courses and practice included.
Get all-accessYes. This app is for learning the rules, one at a time. Before you book OCP 17, rehearse with Enthuware’s full timed mock exams. They train you for the length, the mixed traps, and the clock.
No, and we never say they are. Every drill is original, written from the public OCP 17 objectives, the Java Language Specification, and the Javadoc.
Each code drill is compiled and run on the JDK of every exam it applies to. The answer is what the JVM did, and you see its output.
The one that matches the Java your team runs. The syllabi differ: Java 17 still includes JDBC, and Java 25 adds module imports and compact source files. The app shows which drills apply to yours.