OCP Java SE 25 (1Z0-831) study plan
A good OCP Java SE 25 (1Z0-831) study plan has four phases: work through the ten official exam sections, train yourself to read code the way the compiler and the runtime do, close the gaps on the features new since Java 21, then rehearse with timed mock exams until you pass with margin. Nearly every question shows a program and asks what it does, so writing and running small programs is part of the plan from the first day, not something saved for the end.
Know what kind of exam this is
The exam is about the Java language and its core APIs, not a framework or a tool. A typical item is a short program followed by "What is the result?", with options that mix printed output, "Compilation fails" and "An exception is thrown at runtime". Knowing what a method is for is not enough: you have to know exactly what it returns, what it throws and which line stops the code compiling.
Oracle lists ten exam sections and their objectives but publishes no weights for them, so plan to cover every section rather than betting on a few. Our lessons and questions follow the official 1Z0-831 objectives one for one.
Phase 1 — Orient (a day or two)
Read the official exam topics once, end to end, and install a JDK 25 so you can run code from the first day. In source-file mode, java Main.java compiles and runs a single file in one step, which is the fastest way to settle a question you are unsure about.
Answer a short practice session cold. Experienced Java developers usually find that the gaps are not where they expect: rarely used rules (overload resolution, initialization order, definite assignment, checked exceptions in lambdas) cost more marks than unfamiliar APIs.
Phase 2 — Work through the ten sections (the bulk of the plan)
Pair every lesson with a practice session on the same topic the same day, and run any snippet whose result surprises you. The habit to build is a two-pass read: first as the compiler (types, access, unreachable code, unhandled checked exceptions), then as the runtime.
- Values and text: primitives, wrappers, operators and casting; String, StringBuilder and text blocks; the Date-Time API including time zones and daylight saving.
- Flow control: if/else, switch statements and switch expressions, loops, break and continue.
- Object-oriented Java: objects and nested classes, classes and records, constructors (including flexible constructor bodies) and initializers, overloading and var-args, scope, immutability, var and unnamed variables, inheritance with abstract and sealed types, interfaces and enums.
- Exceptions: try/catch/finally, try-with-resources, multi-catch and custom exceptions.
- Arrays and collections: List, Set, Map, Deque and sequenced collections, and sorting.
- Streams and lambdas: object and primitive streams, reduction, grouping and partitioning, and gatherers.
- Packaging: modules and services, module import declarations, compiling and running code (compact source files, instance main methods, multi-file programs), JARs, runtime images and migration.
- Concurrency: platform and virtual threads, executors, scoped values, locks and the concurrent API, concurrent collections and parallel streams.
- I/O: console and file streams, serialization, and Path objects with java.nio.file.
- Localization: locales, resource bundles, and formatting messages, dates, numbers, currency and percentages.
Phase 3 — Close the gaps on the Java 25 additions (a few days)
Older study material, written for Java 17 or 21, says nothing about several features this exam lists by name: unnamed variables, flexible constructor bodies, stream gatherers, scoped values, module import declarations, compact source files with instance main methods, and launching multi-file source programs. Give each one a lesson, a practice session and a few programs of your own.
Then rebuild practice sessions from your incorrect and flagged questions until no rule keeps reappearing. The cheat sheet for this exam collects every lesson’s key takeaways in one place for the final pass.
Phase 4 — Rehearse with timed mock exams
Sit full-length timed mock exams under real conditions, with no IDE and no compiler. The time per question is generous, which tempts you to trace every line of every program; practise finding the line that decides the answer instead, and keep full walk-throughs for the items you flag.
Between mocks, work through every incorrect answer and run the code until you can say why each wrong option is wrong. Book when consecutive mocks clear the pass mark with margin and no section trails the rest.
Signals you are ready
Book the exam when all of these are true:
- Consecutive full-length timed mocks clear the pass mark with room to spare.
- No section is clearly behind the others in your per-domain results.
- You spot "Compilation fails" before you start tracing output, rather than after.
- You can explain overload resolution, class initialization order and switch pattern dominance without notes.
Plan your prep
Questions, answered
Source
Exam facts in this guide come from the vendor's published exam guide. Vendors revise these — check the source for the current version before you book.
- Java SE 25 Developer Professional (1Z0-831) exam page and topics — Oracle University