All certifications / OCP Java / Lessons
OCP Java 1Z0-831 (Java SE 25) lessons
Study OCP Java for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the OCP Java study planA week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Domain 1: Handling date, time, text, numeric and boolean values
- Primitive types, literals (underscores, binary/hex/octal), default values
- Wrapper classes, autoboxing/unboxing and Integer caching with ==
- Operator precedence, increment/decrement, compound assignment with implicit casts
- Widening and narrowing conversions, casting and numeric promotion rules
- Math API: round, floor, ceil, abs, max/min, pow
- String immutability and key methods: substring, indexOf, charAt, strip, repeat, isBlank
- StringBuilder methods: append, insert, reverse, delete, replace
- Text blocks: incidental whitespace, \ line continuation, \s escape
- Date-Time API: LocalDate, LocalTime, LocalDateTime, ZonedDateTime, Instant
- Period vs Duration and daylight saving time transitions
Domain 2: Controlling program flow
- If/else and the ternary operator
- Classic switch statements, fall-through and break
- Switch expressions with arrow labels, multiple labels and yield
- Pattern matching in switch: type patterns, record patterns and when guards
- Case dominance and exhaustiveness (enums, sealed types, default)
- While, do-while, for and enhanced for loops
- Break and continue, including labeled statements
- Unreachable code and definite assignment compile errors
Domain 3: Using object-oriented concepts in Java
- Classes, fields, methods, constructors, initializer blocks and initialization order
- Flexible constructor bodies (Java 25): statements before super(...) or this(...)
- Inheritance, overriding vs overloading vs hiding, polymorphism and casting
- Abstract classes and interfaces: default, static and private interface methods
- Records: components, canonical and compact constructors, accessors, equals/toString
- Sealed classes and interfaces: permits, final, sealed and non-sealed subclasses
- Enums with fields, constructors, methods and values()/valueOf()/ordinal()
- Nested, inner, local and anonymous classes
- Instanceof pattern matching and flow scoping
- Encapsulation, immutable objects and var local type inference
- Object lifecycle and garbage collection eligibility
Domain 4: Handling exceptions
- Checked vs unchecked exceptions and the Throwable hierarchy
- Try/catch/finally flow, including return in try and finally
- Multi-catch rules: no related types; the catch variable is effectively final
- Catch block ordering and unreachable catch compile errors
- Try-with-resources, AutoCloseable and reverse close order
- Suppressed exceptions and Throwable.getSuppressed()
- Declaring exceptions with throws and overriding rules
- Creating custom checked and unchecked exceptions
Domain 5: Working with arrays and collections
- Declaring, creating and copying arrays; Arrays.sort, binarySearch, compare, mismatch
- List, Set, Map, Queue and Deque interfaces and their main implementations
- Unmodifiable collections: List.of, Set.of, Map.of and Arrays.asList behavior
- Sequenced collections: getFirst, getLast, addFirst, reversed
- Map methods: merge, computeIfAbsent, getOrDefault, putIfAbsent
- Sorting with Comparable and Comparator (comparing, thenComparing, reversed)
- TreeSet and TreeMap natural ordering
- Generics: type parameters, bounded types and wildcards (? extends, ? super)
- List.remove(int) vs remove(Object) with Integer lists
Domain 6: Working with streams and lambda expressions
- Functional interfaces in java.util.function: Supplier, Consumer, Function, Predicate, UnaryOperator, BinaryOperator
- Lambda syntax, method references and effectively final variables
- Creating streams: collections, Stream.of, IntStream.range/rangeClosed, Stream.iterate
- Intermediate operations and lazy evaluation: filter, map, flatMap, peek, sorted, distinct, limit
- Terminal operations: forEach, reduce, collect, count, findFirst, anyMatch, toList
- Collectors: groupingBy, partitioningBy, counting, joining, toMap and merge functions
- Primitive streams and summary statistics
- Optional: of, ofNullable, map, orElse, orElseGet, orElseThrow
- Stream Gatherers (Java 24+): gather() with Gatherers.windowFixed, windowSliding, fold, scan
- Parallel streams and why stateful lambdas cause problems
Domain 7: Packaging and deploying Java code
- Module-info.java: module, requires, requires transitive, exports, opens
- Services: uses, provides ... with, and ServiceLoader
- Module path vs class path, named, automatic and unnamed modules
- Compiling and running modules with javac --module-path and java --module
- Module import declarations (Java 25): import module and ambiguity rules
- Compact source files and instance main methods (Java 25), java.lang.IO
- Launching single-file and multi-file source programs with the java launcher
- JDK tools: jar, jdeps, jlink
Domain 8: Managing concurrent code execution
- Creating threads with Runnable, Thread, and the Thread.Builder API
- Platform threads vs virtual threads; Executors.newVirtualThreadPerTaskExecutor()
- ExecutorService, Callable and Future; shutdown, awaitTermination, close()
- Thread lifecycle and start() vs run()
- Race conditions, synchronized blocks and methods, and visibility
- Atomic classes (AtomicInteger, AtomicLong) and locks (ReentrantLock, tryLock)
- Concurrent collections: ConcurrentHashMap, CopyOnWriteArrayList, BlockingQueue
- Deadlock, starvation and livelock
- Scoped values (Java 25): ScopedValue.where(...).run(...) as an alternative to ThreadLocal
Domain 9: Using the Java I/O API
- Path creation and operations: resolve, relativize, normalize, getFileName, getParent
- Files methods: exists, createDirectory vs createDirectories, copy, move, delete
- Reading and writing text with Files.readAllLines, Files.lines, Files.writeString
- Walking file trees: Files.list vs Files.walk vs Files.find
- Byte and character streams, BufferedReader and BufferedWriter
- Console and standard input/output
- Serialization: Serializable, transient fields, serialVersionUID
- Closing resources and stream-returning Files methods
Domain 10: Implementing localization
- Locale objects: language, country, Locale.of and Locale.getDefault
- Resource bundles: properties files, naming and lookup/fallback order
- Formatting numbers and currency with NumberFormat
- Compact number formatting (CompactNumberFormat)
- Formatting and parsing dates and times with DateTimeFormatter and locales
- Message formatting with MessageFormat