The Art of Java Language Pattern Matching
summary
Covers how Java now binds type tests and extracts components: pattern matching for instanceof (added in JDK 14), pattern matching for switch with exhaustiveness checks and a guarded 'when' pattern, and deconstruction via record patterns plus composable nested extraction. Shows unnamed pattern underscore (_) and local-var inference to reduce clutter, explains sealed types making switches exhaustive, and notes primitives landed in pattern contexts (JDK 23) and unnamed patterns (JDK 20), with examples and scoping rules.
AI-written summary · about
