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.
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.
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.