1. Overview: What is Java OCP?
The Oracle Certified Professional: Java SE Developer (OCP) certification is Oracle's professional-level Java credential. It validates that a developer has deep, working knowledge of modern Java — including features introduced from Java 8 through the latest LTS release.
Two current OCP exams are available in 2026:
- Java SE 17 OCP (1Z0-829) — Based on Java 17, the previous Long-Term Support release. Widely accepted by employers and still in active demand.
- Java SE 21 OCP (1Z0-830) — Based on Java 21, the current LTS release. Reflects the latest language features including virtual threads, record patterns, and sequenced collections.
Both certifications cover Java thoroughly, but the topics differ significantly. This guide breaks down what's on each exam so you can prepare with confidence.
2. Exam Format & Logistics
Both Java 17 and Java 21 OCP exams follow the same general format, with minor variations:
Question Type
Multiple Choice
Mode
Online / Test Center
Question Format
Questions are typically scenario-based. You'll see a code snippet (5–15 lines), and you'll need to predict the output, identify a compile error, or choose the correct way to complete a snippet. Many questions are multi-select — you must select all correct answers to get credit.
Important: Single wrong selection in a multi-select question counts as the entire question wrong. Read each option carefully.
Java SE 17 OCP (1Z0-829)
3. Java 17 OCP — Complete Syllabus
The Java 17 OCP exam covers Java language features from Java 8 through Java 17, with significant emphasis on functional programming, streams, modules, and modern language features introduced in Java 9–17.
1. Handling Date, Time, Text, Numeric, and Boolean Values
- Use primitives, wrapper classes, and autoboxing
- Manipulate text with String, StringBuilder, and text blocks
- Manipulate date, time, duration, period, instant, and time-zone objects
2. Controlling Program Flow
- Create program flow control using if/else, switch statements and expressions, loops, break, continue
- Use pattern matching with instanceof
- Switch expressions with arrow syntax
3. Using Java Object-Oriented Approach
- Declare and instantiate Java objects including nested classes
- Define and use fields and methods, constructors, instance/static initializers
- Implement overloading, including method varargs
- Use enumerations including switch statements with enums
- Declare, instantiate, and use record classes
- Implement inheritance: classes, abstract classes, final keyword
- Implement sealed classes and interfaces
- Implement interfaces including default methods, static methods, and private methods
- Implement polymorphism, distinguish between compile-time and runtime type
- Cast a value, including pattern matching with instanceof
- Identify, understand, and use the Object class methods (equals, hashCode, toString)
4. Handling Exceptions
- Handle exceptions using try/catch/finally, try-with-resources, and multi-catch statements
- Distinguish between checked and unchecked exceptions
- Throw exceptions, recognize exception classes, and create custom exceptions
5. Working with Arrays and Collections
- Create Java arrays, List, Set, Map, and Deque collections
- Add, remove, update, retrieve, sort, and search elements in lists, arrays, and matrices
- Use Comparator and Comparable interfaces
6. Working with Streams and Lambda Expressions
- Use Java object and primitive Streams, including lambda expressions implementing functional interfaces
- Perform decomposition, concatenation, reduction, grouping, and partitioning on sequential and parallel streams
- Use the built-in functional interfaces (Predicate, Consumer, Function, Supplier and their variants)
- Use Optional to handle absent values
7. Packaging and Deploying Java Code and Using the Java Platform Module System (JPMS)
- Define modules and their dependencies, expose module content, and use service loaders
- Create runtime modules and applications
- Document, package, and deploy Java applications
8. Managing Concurrent Code Execution
- Use Java parallel streams
- Create worker threads using Runnable and Callable
- Manage thread execution with the Executors framework and thread pools
- Develop thread-safe code using locks, synchronized blocks, and concurrent API classes
- Process Java collections concurrently and use parallel streams
9. Using Java I/O API
- Read and write console and file data using I/O Streams
- Implement serialization and deserialization techniques on Java objects
- Handle file system objects using java.nio.file API (Path, Files)
10. Accessing Databases Using JDBC
- Create connections, perform CRUD operations, and configure properties using JDBC API
11. Implementing Localization
- Implement localization using Locale, resource bundles, and Java APIs to parse and format messages, dates, and numbers
Java SE 21 OCP (1Z0-830)
4. Java 21 OCP — Complete Syllabus
The Java 21 OCP exam updates the syllabus to reflect Java's evolution through Java 21, including major additions like virtual threads, record patterns, and sequenced collections. JDBC is no longer included in this exam.
Major Change: JDBC is removed from the Java 21 OCP syllabus. If you're focused on database programming, the Java 17 OCP (1Z0-829) may better align with your goals.
1. Handling Date, Time, Text, Numeric, and Boolean Values
- Use primitives, wrapper classes, autoboxing/unboxing
- Use String, StringBuilder, and text blocks
- Use date, time, duration, period, instant, and time-zone classes
2. Controlling Program Flow
- Use if/else, switch statements and expressions, loops, break, continue
- Use pattern matching with instanceof and switch (including pattern matching for switch)
- Use record patterns (deconstruction)
3. Java Object-Oriented Approach
- Declare and instantiate objects, classes, records, abstract classes, sealed classes, interfaces
- Use inheritance, polymorphism, casting (including pattern-matching cast)
- Implement constructors, methods, fields, static and instance members
- Use enumerations including enhanced switch with enums
- Use Object class methods (equals, hashCode, toString)
- Use record patterns in switch and instanceof
4. Exception Handling
- Handle exceptions using try/catch/finally, try-with-resources, multi-catch
- Throw exceptions, including custom checked and unchecked exceptions
- Distinguish between checked and unchecked exceptions
5. Arrays and Collections (including Sequenced Collections)
- Create and use Java arrays, List, Set, Map, Deque, and the new SequencedCollection, SequencedSet, and SequencedMap interfaces
- Use addFirst(), addLast(), getFirst(), getLast(), reversed() methods (JEP 431)
- Add, remove, update, retrieve, sort, and search elements
- Use Comparator and Comparable interfaces
6. Streams and Lambda Expressions
- Use object and primitive Streams with lambda expressions
- Perform decomposition, concatenation, reduction, grouping, partitioning
- Use built-in functional interfaces (Predicate, Consumer, Function, Supplier)
- Use Optional to handle absent values
- Use new stream operations such as Stream.mapMulti and Stream.toList()
7. Java Platform Module System (JPMS)
- Define modules and dependencies
- Expose module content, use service loaders
- Create runtime modules and applications using jlink and jpackage
8. Concurrent Programming (Virtual Threads & Structured Concurrency)
- Create and manage threads using Runnable, Callable, and Future
- Use the Executors framework and thread pools
- Use Virtual Threads (JEP 444) for high-throughput concurrent applications
- Understand Structured Concurrency (preview/incubator) concepts
- Develop thread-safe code with locks, synchronized blocks, and concurrent API classes
- Use parallel streams for concurrent processing
9. Java I/O API
- Read and write to files and console using I/O streams
- Implement serialization and deserialization
- Use java.nio.file API (Path, Files)
10. Secure Coding in Java SE Applications
- Develop code that mitigates common Java security vulnerabilities (input validation, immutability, defensive copying)
- Use secure coding practices for handling sensitive data
11. Localization
- Implement localization using Locale, resource bundles, and number/date formatting
5. Key Differences: Java 17 vs Java 21 Syllabus
While the two exams share most fundamental topics, several important differences exist:
What's New in Java 21 OCP (Not in Java 17)
- Virtual Threads (JEP 444) — Lightweight threads for high-throughput concurrent applications
- Sequenced Collections (JEP 431) — New interfaces (SequencedCollection, SequencedSet, SequencedMap) with addFirst, getFirst, reversed methods
- Record Patterns — Pattern matching for deconstructing records
- Pattern Matching for switch — Type patterns in switch statements/expressions
- Structured Concurrency — Treating multiple tasks as a single unit of work
- Secure Coding — Dedicated section on Java security best practices
- Stream Updates — New methods like Stream.mapMulti and Stream.toList()
What's Removed from Java 21 OCP
- JDBC — Database connectivity is no longer covered in 1Z0-830
What's Unchanged
- Core OOP principles (classes, inheritance, polymorphism, encapsulation)
- Exception handling fundamentals
- Collections framework basics (List, Set, Map, Deque)
- Streams and lambdas (with minor additions in Java 21)
- Java Platform Module System
- I/O and NIO.2
- Localization
6. How to Prepare for Java OCP
The OCP exams are challenging — the questions test deep understanding, not memorization. A typical preparation timeline is 6 to 12 weeks of focused study for experienced Java developers, longer for those new to functional programming or modules.
Recommended Study Approach
- Read the official Oracle exam objectives — Confirm the exact topics for your chosen exam version on the Oracle Certification site
- Use a comprehensive study book — Boyarsky and Selikoff's OCP Java SE 17 Study Guide is widely regarded as the gold standard for 1Z0-829
- Practice with real code — Read code, write code, predict output before running it. Many exam questions are output-prediction format
- Take practice exams — Practice tests reveal which topics you've truly mastered and which need more work. The OCP is heavily code-reading focused; you need exposure to many code patterns
- Focus on weak areas — After each practice test, review every wrong answer thoroughly before moving on
- Time yourself — At 90 minutes for 50 questions, you have under 2 minutes per question. Practice maintaining pace
Common Pitfalls
- Underestimating streams and lambdas — these are tested extensively
- Memorizing instead of understanding — questions test edge cases that defeat rote learners
- Skipping JPMS — modules feel optional but Oracle includes them on most exam attempts
- Not practicing multi-select questions — easy to lose marks here
- Java 21 specifically: not practicing record patterns and sequenced collections
✨ Practice with 2,000+ OCP Questions
Realistic practice tests for both Java 17 (1Z0-829) and Java 21 (1Z0-830) with detailed explanations.
Start Free Trial →
3 days free • Both exams covered • Downloadable certificates