Skip to main content

2 docs tagged with "pattern-matching"

View all tags

Chapter 3 — Making Decisions

Complete guide to Java control flow: if/else, switch statements and expressions, while/do-while/for loops, break/continue with labels, and pattern matching — including Java 21 switch with when guards.

Chapter 7 — Beyond Classes

Covers interfaces (default, static, private methods), functional interfaces, enums with fields/constructors, records, sealed classes, and nested classes — all featuring heavily in the OCP Java 21 exam with Java 21-specific additions like pattern matching and exhaustive switch.