In this lecture, we break down the modern
switch with pattern matching:
case branches with automatic type narrowing, handling
null via
case
null, guard conditions
when, exhaustive checks with
sealed hierarchies, and nested patterns for
record. We show practical examples, nuances,
JDK 21+ requirements, and common mistakes.