I have been studying for the OCP 17 (1Z0-829) certification, and I just found out that the OCP 21 (1Z0-830) certification was announced this summer. I’ve taken a look at the differences in the exam topics, so you don’t have to.

The announcement of the new certification mentions four advancements of Java 21 that you can take advantage of:

  1. Pattern matching for Switch – introduced in Java 21 after four previews starting with Java 17.
  2. Record Patterns – introduced in Java 21 after two previews in Java 19 and 20.
  3. Virtual Threads – introduced in Java 21 after two previews in Java 19 and 20.
  4. Sequenced Collections – introduced in Java 21.

Exam Format

Both exams consist of 50 multiple choice questions and have a passing grade of 68%. The main difference in the format is that the OCP 21 exam grants you extra time: 120 minutes compared to 90 minutes for OCP 17.

Differences in exam topics

I’ve catalogued the differences between the OCP 17 (1Z0-829) exam topics and the OCP 21 (1Z0-830) exam topics so you don’t have to. I’ve decided to follow the topics as listed in the OCP 17 certification. Subtopics that have not changed are not included.

Handling date, time, text, numeric and boolean values

Some wording got shuffled around. The mention of parentheses got removed, and applying precedence rules was added.

  1. Use primitives and wrapper classes including Math API, parentheses, type promotion, and casting to evaluate arithmetic and boolean expressions.
  2. Use primitives and wrapper classes. Evaluate arithmetic and boolean expressions, using the Math API and by applying precedence rules, type conversions, and casting.

Daylight savings time got added:

  1. Manipulate date, time, duration, period, instant and time-zone objects using Date-Time API
  2. Manipulate date, time, duration, period, instant and time-zone objects including daylight saving time using Date-Time API.

Controlling Program Flow

No changes.

Utilizing Java Object-Oriented Approach

Topic got reworded to: Using Object-Oriented Concepts in Java

Grammatical changes:

  1. Implement overloading, including var-arg methods
  2. Implement overloaded methods, including var-arg methods.

Grammatical changes:

  1. Understand variable scopes, use local variable type inference, apply encapsulation, and make objects immutable
  2. Understand variable scopes, apply encapsulation, and create immutable objects. Use local variable type inference.

Addition of record classes and the switch construct, and the instanceof operator got a second mention.

  1. Implement inheritance, including abstract and sealed classes. Override methods, including that of Object class. Implement polymorphism and differentiate object type versus reference type. Perform type casting, identify object types using instanceof operator and pattern matching
  2. Implement inheritance, including abstract and sealed types as well as record classes. Override methods, including that of the Object class. Implement polymorphism and differentiate between object type and reference type. Perform reference type casting, identify object types using the instanceof operator, and pattern matching with the instanceof operator and the switch construct.

Grammatical changes:

  1. Create and use enumerations with fields, methods and constructors
  2. Create and use enum types with fields, methods, and constructors.

Handling Exceptions

No changes.

Working with Arrays and Collections

No changes, save for the removal of ‘Java’.

  1. Create Java arrays, List, Set, Map, and Deque collections, and add, remove, update, retrieve and sort their elements
  2. Create arrays, List, Set, Map and Deque collections, and add, remove, update, retrieve and sort their elements.

Working with Streams and Lambda expressions

Supply got changed to create, map to transform, and consume to process:

  1. Use Java object and primitive Streams, including lambda expressions implementing functional interfaces, to supply, filter, map, consume, and sort data
  2. Use Java object and primitive Streams, including lambda expressions implementing functional interfaces, to create, filter, transform, process, and sort data.

Packaging and deploying Java code and use the Java Platform Module System

Topic got reworded to: Packaging and Deploying Java Code.

Grammatical changes:

  1. Define modules and their dependencies, expose module content including for reflection. Define services, producers, and consumers
  2. Define modules and expose module content, including that by reflection, and declare module dependencies, define services, providers, and consumers.

Grammatical changes:

  1. Compile Java code, produce modular and non-modular jars, runtime images, and implement migration using unnamed and automatic modules
  2. Compile Java code, create modular and non-modular jars, runtime images, and implement migration to modules using unnamed and automatic modules.

Managing Concurrent Code Execution

The mention of worker threads is removed, platform and virtual threads got added. The mention of automations got removed.

  1. Create worker threads using Runnable and Callable, manage the thread lifecycle, including automations provided by different Executor services and concurrent API
  2. Create both platform and virtual threads. Use both Runnable and Callable objects, manage the thread lifecycle, and use different Executor services and concurrent API to run tasks.

Grammatical changes:

  1. Process Java collections concurrently including the use of parallel streams
  2. Process Java collections concurrently and utilize parallel streams.

Using Java I/O API

Construct was added and createa is moved back one position in the list.

  1. Create, traverse, read, and write Path objects and their properties using java.nio.file API
  2. Construct, traverse, create, read, and write Path objects and their properties using the java.nio.file API.

Accessing databases using JDBC

Topic is not part of OCP 21.

Implementing Localization

Grammatical changes:

  1. Implement localization using locales, resource bundles, parse and format messages, dates, times, and numbers including currency and percentage values
  2. Implement localization using locales and resource bundles. Parse and format messages, dates, times, and numbers, including currency and percentage values.

Assume the following:

No changes.

Candidates are also expected to:

No changes.

Final Thoughts

The removal of JDBC as an exam topic is a big one. The four new features mentioned in the announcement are all part of larger topics. Of these four, pattern matching for switch and virtual threads seem to be the biggest updates.

You get an extra 30 minutes to sit the exam, whether this suggests anything about the difficulty of the questions I cannot say. I have taken one OCP 17 exam as a tryout and I had a little less than 10 minutes left after having answered and reviewed all questions. It felt a bit tight time-wise so an extra 30 minutes sounds nice.

The study guide for it will be published in November of this year and is available for preorder at your favourite (online) bookseller.

Meanwhile, I will continue studying for OCP 17 and look into the new features that got introduced in Java 21. To be continued…