Modern Java
Pattern matching for instanceof and switch, record patterns, unnamed variables, compact source files, and a map of every release from Java 8 to 25.
Java changed more between 2014 and 2025 than in the twenty years before. Since Java 10 a new version ships every six months, and many features first appear as previews you can try before they become permanent. This phase teaches the modern features that change how everyday Java code looks: asking "what shape is this value?" and taking it apart in one step.
You'll start with **pattern matching for instanceof (Java 16), move to pattern matching for switch and record patterns (Java 21), which together with sealed types (Topic 5.11) and records (Topic 4.9) give Java a safe, compiler-checked way to model data. Then come the newest pieces: unnamed variables and patterns** with _ (Java 22) and **compact source files with instance main methods** (Java 25), which let a first program be a single void main().
The last topic is a map of what changed in every release from Java 8 to Java 25, so you can read any codebase, know which version a feature needs, and plan an upgrade. Examples that need Java 21 are marked; Java 22 and 25 features are shown as code you run on your own JDK, because the in-browser runner uses Java 17.