OCP Java 21 Course Outline — Study Plan for the 1Z0-830 Exam
Full table of contents for the OCP Java 21 course: 93 articles across sixteen chapters, each with a verified practice quiz, plus a pre-study diagnostic, chapter reviews and three mock exams. The reading order for the Oracle 1Z0-830 exam and its Java 25 successor (1Z0-831).
kvi5hnuCode Sprout team member9 min readOn this page
This page is the map of the OCP Java 21 course. Every article teaches one exam objective, is paired with a verified practice quiz, and is written to the exam's own semantics (Java 21), with Java 22–27 changes called out explicitly. The course targets the 1Z0-830 exam and includes a chapter on what's new for the upcoming 1Z0-831 (Java 25).
Who this course is for
- Experienced Java developers preparing for Oracle Certified Professional: Java SE 21 Developer (1Z0-830).
- Developers who passed an older OCA/OCP (8 or 11) and want to update to Java 21 features: records, sealed classes, pattern matching, text blocks, switch expressions, virtual threads, sequenced collections, the module system, modern
java.time. - Teams onboarding to JDK 21/25 LTS who want a working reference across the full standard library used by the exam.
If you are new to Java, read Core Java I first (language), then Core Java II (libraries), then come back here for the exam prep.
How this course is organised
Sixteen chapters, 93 articles. Each article is short enough to read in one sitting (10–20 minutes), has at least one runnable public class Solution program verified on JDK 25, and ends with its own 10-question quiz. A chapter review quiz (20 questions) follows each chapter, and three mock exams (50 questions each, 68 % pass, like the real test) close the course.
| # | Chapter | What it covers |
|---|---|---|
| 0 | The exam | Format, objectives, question styles, test-taking tactics |
| 1 | Building Blocks | JDK tools, main methods, packages, variables, scope, GC |
| 2 | Operators | Precedence, promotion, casting, equality, ternary |
| 3 | Making Decisions | if/else, switch, pattern matching, loops, labels |
| 4 | Core APIs | String, StringBuilder, arrays, Math, java.time |
| 5 | Methods | Modifiers, parameters, static members, overloading |
| 6 | Class Design | Inheritance, constructors, overriding, immutability |
| 7 | Beyond Classes | Interfaces, enums, sealed classes, records, nested classes |
| 8 | Lambdas and Functional Interfaces | Lambdas, method refs, built-in functional interfaces |
| 9 | Collections and Generics | List / Set / Map, sequenced collections, generics |
| 10 | Streams | Pipelines, terminal/intermediate ops, primitive streams, collectors |
| 11 | Exceptions and Localization | Checked/unchecked, try-with-resources, locales, bundles |
| 12 | Modules | module-info, services, jdeps/jlink, migration |
| 13 | Concurrency | Threads, virtual threads, executors, locks, parallel streams |
| 14 | I/O | Path, Files, byte/character streams, serialization |
| 15 | Beyond the exam | Java 22–25 features for 1Z0-831, plus 26/27 |
How to use the quizzes
Four kinds of quizzes, filed under /quiz/:
- Assessment test — 31-question diagnostic, before any article.
- Article quizzes — one per article, about 10 questions, right after you read the article. They verify the single topic the article teaches.
- Chapter reviews — one per chapter (20 questions), after you finish the chapter.
- Mock exams — three 50-question papers at exam difficulty, 68 % pass, 120 minutes each, when you finish the course.
Every quiz question includes a worked explanation and a chapter reference, so a wrong answer sends you straight to the right article.
Chapter 0 — The Exam
- OCP Java 21 Exam Guide (1Z0-830) — exam format, objectives, 1Z0-831, study plan, question styles, test-taking tactics.
- Quiz: Assessment Test.
Chapter 1 — Building Blocks
- JDK, JVM, Class Structure and the
mainMethod — JDK tools, class/file structure, comments,main()forms, Java 25 compact source files. - Packages, Imports, Compiling and the Class Path — packages, imports, wildcards, conflicts,
javac/java/jaroptions. - Creating Objects: Constructors and Initializer Blocks — constructors, fields, instance initializers, order of initialization.
- Primitive Types, Literals and Wrapper Classes — primitive types, literals, underscores, bases, wrappers, text blocks.
- Declaring and Initializing Variables, and
var— identifiers, defaults,varrules. - Variable Scope and Garbage Collection — scope, eligibility for GC,
finalizehistory. - Chapter review quiz: Chapter 1 Review.
Chapter 2 — Operators
- Operators: Precedence and Unary — operator types, precedence, unary, increment/decrement.
- Arithmetic, Numeric Promotion, Casting and Assignment — binary arithmetic, promotion, casting, compound assignment.
- Equality, Relational, Logical and Ternary Operators —
==,instanceof, relational, logical, short-circuit, ternary. - Chapter review quiz: Chapter 2 Review.
Chapter 3 — Making Decisions
if/else, Pattern Matching forinstanceof— statements, blocks, pattern matching, flow scoping.switchStatements and Expressions — statements, case values, expressions,yield, exhaustiveness.switchPattern Matching and Record Patterns — type patterns, guards, null, dominance, record patterns.while,do-whileandforLoops —while,do/while,for, for-each, infinite loops.break,continue, Labels and Unreachable Code — labels,break,continue,return.- Chapter review quiz: Chapter 3 Review.
Chapter 4 — Core APIs
- Strings: Concatenation and Immutability — creating strings, concatenation, immutability.
- String Methods for the Exam —
length,charAt,indexOf,substring,replace,strip,indent,formattedand more. StringBuilder— mutability, chaining, methods.==vsequalsand the String Pool — identity, equality,intern.- Arrays: Creating, Sorting, Searching — declaring, using, sorting, searching.
- Arrays: Compare, Mismatch, Multidimensional —
equals/compare/mismatch, varargs, 2-D arrays. - The
MathAPI andBigDecimal—Mathmethods, rounding,BigInteger/BigDecimalbasics. LocalDate,LocalTime,LocalDateTimeandZonedDateTime— creating, manipulating, immutability.Period,Duration,Instantand Daylight Saving —Period,Duration,Instant, DST.- Chapter review quiz: Chapter 4 Review.
Chapter 5 — Methods
- Method Declarations — access modifiers, optional specifiers, return types, parameters, exceptions, body.
- Local, Instance Variables and Varargs — variable modifiers, effectively final, varargs rules.
- Access Modifiers —
private, package,protected,public. staticMembers and Static Imports — static methods/fields, static initializers, static imports.- Pass by Value and Autoboxing — passing data, returning objects, autoboxing/unboxing.
- Method Overloading and Resolution — overloading rules and resolution order.
- Chapter review quiz: Chapter 5 Review.
Chapter 6 — Class Design
- Inheritance and Class Modifiers — single inheritance,
Object, class modifiers,this/super. - Constructors:
this()andsuper()— declaring constructors, default constructor, Java 25 flexible constructor bodies. - Initialization Order and
finalFields — class/instance initialization order,finalfields. - Overriding and Hiding Members — overriding rules, hiding static members,
finalmethods. - Abstract Classes — abstract classes/methods, concrete subclasses, constructors.
- Immutable Objects — the immutability recipe, defensive copies.
- Chapter review quiz: Chapter 6 Review.
Chapter 7 — Beyond Classes
- Interfaces and Abstract Methods — declaring/implementing, implicit modifiers, inheritance, conflicts.
- Interface
default,staticandprivateMethods — default, static, private, private static. - Enums — simple/complex enums, constructors, fields, methods,
switch. - Sealed Classes and Interfaces —
sealed/permits/final/non-sealed, rules. - Records — records, compact/overloaded constructors, customizing.
- Record Patterns and Nested Patterns — record patterns in
instanceof/switch, nesting, generic records. - Nested Classes: Inner and Static — inner classes, static nested classes.
- Local and Anonymous Classes — local classes, anonymous classes, choosing nested types.
- Polymorphism and Casting — object vs reference type, casting, polymorphism and overriding.
- Chapter review quiz: Chapter 7 Review.
Chapter 8 — Lambdas and Functional Interfaces
- Lambda Syntax — lambda forms, parameters, bodies,
varin lambdas. - Functional Interfaces —
@FunctionalInterface, SAM rules,Objectmethods. - Method References — four kinds of method references.
- Built-in Functional Interfaces —
Supplier,Consumer,BiConsumer,Predicate,Function,UnaryOperator,BinaryOperator. - Convenience Methods and Primitive Functional Interfaces —
andThen/compose/negate, primitive specializations. - Lambda Variables and Effectively Final — parameter lists, local/instance/class variables in lambdas.
- Chapter review quiz: Chapter 8 Review.
Chapter 9 — Collections and Generics
- The Collection API and Common Methods —
Collectionmethods, factories, iteration. - The
ListInterface —ArrayList/LinkedList,List.of/copyOf/asList. Set,QueueandDeque—HashSet/TreeSet,Queue/Deque,ArrayDeque.- The
MapInterface —HashMap/TreeMap,merge/compute. - Sorting:
ComparableandComparator— chaining,sortandbinarySearch. - Sequenced Collections —
SequencedCollection/Set/Map(Java 21). - Generic Classes and Methods — generic classes, interfaces, methods, type erasure.
- Generic Wildcards and Bounds — unbounded, upper- and lower-bounded wildcards.
- Chapter review quiz: Chapter 9 Review.
Chapter 10 — Streams
Optional— creating and usingOptional.- Stream Pipelines and Creating Streams — pipeline flow, finite/infinite sources.
- Stream Terminal Operations —
count,min/max,find,match,forEach,reduce,collect. - Stream Intermediate Operations —
filter,distinct,limit/skip,map,flatMap,sorted,peek. - Primitive Streams —
IntStreamand friends, mapping between stream types. - Collectors: Grouping and Partitioning —
joining,toMap,groupingBy,partitioningBy,teeing. - Chapter review quiz: Chapter 10 Review.
Chapter 11 — Exceptions and Localization
- Checked and Unchecked Exceptions — exception hierarchy, throwing, overriding rules.
- Common Exception Classes — runtime, checked and error classes the exam uses.
try/catch, Multi-catch andfinally— chaining, multi-catch,finally,System.exit.- Try-with-Resources and Suppressed Exceptions —
AutoCloseable, scope, close order, suppressed. - Formatting Numbers, Dates and Strings —
NumberFormat/DecimalFormat,DateTimeFormatter,String.format. - Locales and Localized Formatting —
Locale, localizing numbers, dates,Locale.Category. - Resource Bundles and
MessageFormat— resource bundles, lookup order,MessageFormat. - Chapter review quiz: Chapter 11 Review.
Chapter 12 — Modules
- Your First Modular Program — benefits,
module-info, compiling, running. requires,exports,opens— multiple modules,requires transitive.- Module Services — SPI, locator, consumer, provider,
ServiceLoader. - Module Commands:
--describe-module,jdeps,jlink— tools and command options. - Named, Automatic, Unnamed Modules and Migration — module types, migration strategies.
- Chapter review quiz: Chapter 12 Review.
Chapter 13 — Concurrency
- Threads: Platform and Virtual — thread types, creating, states, daemon, virtual threads.
ExecutorService,CallableandFuture— submit,invokeAll/invokeAny, scheduling, shutdown.- Thread Safety: Atomic and
synchronized— atomicity,volatile, atomic classes. - Locks,
CyclicBarrierand Concurrency Tools —Lock/ReentrantLock,tryLock, barriers. - Concurrent Collections and Threading Problems — concurrent collections, deadlock, livelock, races.
- Parallel Streams — parallel decomposition, reductions, ordering.
- Chapter review quiz: Chapter 13 Review.
Chapter 14 — I/O
FileandPath: Creating — creating, converting.- Path Operations and
FilesMethods —normalize/resolve/relativize, existence, creating. Files: Copy, Move, Delete, Attributes — copy, move, delete, attributes.- I/O Streams Overview — byte vs character, input/output, low/high-level.
- Reading and Writing Files — reading/writing with I/O streams and
Files. - Serialization —
Serializable,transient,serialVersionUID, records. - Console and User Interaction —
System.in/out/err,Console. walk,find,linesand Advanced I/O —mark/reset,walk,find,lines,list.- Chapter review quiz: Chapter 14 Review.
Chapter 15 — Beyond the Exam
- What's New in Java 22–25 (and a Peek at 26/27) — features after Java 21 that matter for the Java 25 exam.
- Final Review and Mock Exams — final review checklist and the three mock exams.
- Mock exams: Mock Exam 1, Mock Exam 2, Mock Exam 3.
Start here: Assessment Test (diagnostic), then OCP Java 21 Exam Guide.
Related reading

More in OCP Java 21
OCP Java 21 Mock Exam 3 (1Z0-830)
The third full 50-question mock exam for the OCP Java SE 21 Developer exam (1Z0-830), weighted toward the hardest areas: streams, concurrency, generics, modules and I/O. 120 minutes, 68% to pass, with explanations.
OCP Java 21 Mock Exam 2 (1Z0-830)
The second full 50-question mock exam for the OCP Java SE 21 Developer exam (1Z0-830): new questions on every objective, with more multi-select. 120 minutes, 68% to pass, with an explanation for every answer.
OCP Java 21 Mock Exam 1 (1Z0-830)
A full 50-question mock exam for the OCP Java SE 21 Developer exam (1Z0-830), covering every objective at exam difficulty. 120 minutes, 68% to pass, with an explanation for every answer.
Quiz: Final Review (OCP 21)
Ten exam-style questions mixing the most-tested OCP Java 21 rules from the final checklist: promotion, String immutability, overloading, initialization order, collections, streams, exceptions and switch patterns, with explanations.
Discussion
Sign in to ask a question or share what you learned.