Skip to content

Contents

The book starts with the foundations every Java developer needs, then follows each part of the language forward through the releases that changed it, ending with the features that define modern Java: lambdas, streams, modern concurrency and pattern matching.

flowchart LR
    P1["Part I<br/>Foundations"] --> P2["Part II<br/>Objects"]
    P2 --> P3["Part III<br/>Organizing code"]
    P3 --> P4["Part IV<br/>Data and memory"]
    P4 --> P5["Part V<br/>Errors and text"]
    P5 --> P6["Part VI<br/>Modern Java"]
Chapter What it covers
Part I — Foundations
1 Why Java Exists Bytecode and the JVM → jshell (9) → java File.java (11) → compact source files (25)
2 Types, Variables and Conversions Primitives and casting → compact strings (9) → var (10) → UTF-8 default (18) → _ (22)
3 Operators and Control Flow Precedence, short-circuiting → strings in switch (7) → switch expressions (14) → pattern switch (21)
Part II — Objects
4 Classes, Objects and References Stack vs. heap, references, toString → records (16)
5 Constructors, this, static and Initializer Blocks Constructor chaining, init and static blocks → flexible constructor bodies (25)
6 Methods and Polymorphism Overloading, pass-by-value, binding → covariant returns, varargs
7 Inheritance and Composition super, overriding rules, composition vs. aggregation → sealed classes (17)
8 Abstraction and Interfaces Abstract classes, interfaces → default methods (8) → private methods (9) → sealed interfaces (17)
Part III — Organizing Code
9 Packages, Access and Modules Packages, classpath, access modifiers → modules (9) → module imports (25)
10 Nested and Anonymous Classes → Lambdas Inner, local and anonymous classes → lambdas and method references (8)
Part IV — Data and Memory
11 Arrays → Collections Arrays, array of arrays → List.of (9) → sequenced collections (21)
12 Garbage Collection and Memory Reachability, finalize → G1 (9) → ZGC (15) → compact object headers (25, 27)
Part V — Errors and Text
13 Exceptions try/catch/finally → try-with-resources (7) → helpful NPEs (14)
14 Strings and Text String pool, StringBuilder → text blocks (15) → new String methods (11)
15 Wrapper Classes and Boxing Autoboxing, the integer cache → deprecated constructors (9, 16)
Part VI — Modern Java
16 Functional Java: Streams Loops → streams (8) → gatherers (24)
17 Dates and Times Date and Calendar → java.time (8)
18 Concurrency Threads → executors → virtual threads (21) → scoped values (25) → structured concurrency (preview)
19 Data-Oriented Java Records, sealed types and pattern matching working together (16 → 21)
20 The Modern Toolchain jlink, jpackage, JFR, the HTTP Client (11) → HTTP/3 (26)
Appendices
A Java 7 → 27 at a glance One page, twenty releases
B Migration checklist Moving a Java 7/8 code base to Java 25
C Good to know: look-alikes Ten look-alike pairs, from Comparable vs Comparator to fail-fast vs snapshot iterators