Concept clusters
Related ideas that live chapters apart, pulled onto one page — every way to own memory, every container and when to pick it, and more.
Every way to loop over a collection
Index for, enhanced for, while, an Iterator, removeIf, forEach and a stream: what each one can do, and which to reach for.
11 concepts →
Equality in Java
== on primitives and on references, equals and hashCode, records, strings, boxed numbers and doubles: which comparison each kind of value needs.
12 concepts →
Tools for values that don't change
final, immutable Strings, final fields with no setters, records, defensive copies, List.of and unmodifiable views.
12 concepts →
Every way to handle a missing value
null and NullPointerException, guard clauses, getOrDefault, case null, Optional, and when to throw instead.
9 concepts →
Every way to handle a failure
Catch, declare, wrap, clean up, or let it propagate: the exception tools and the strategy that picks between them.
12 concepts →
Choosing a collection
List, Set, Map, Queue and Deque, their main classes, what each operation costs, and the immutable versions.
9 concepts →
Every way to vary behaviour
Subclass and override, abstract classes, interfaces, default methods, lambdas, sealed types with a switch, composition and Strategy.
11 concepts →
Every way to build text
+ concatenation, printf and String.format, text blocks, String.join and StringBuilder: which fits which job.
7 concepts →
The concurrency toolkit
synchronized, locks, volatile, atomics, concurrent collections, executors, CompletableFuture, virtual threads and structured concurrency.
13 concepts →