Intermediate
Modern Java: 8 to 25
The Java that is written today.
Lambdas, streams, Optional, the date-time API, var, text blocks, records, pattern matching, sealed types and virtual threads — what each release added, what problem it solved, and how it is used in a codebase that has all of them.
14 lessons written3 modules~3h reading
After this course you can
- Write streams that are readable and know when a loop is the better choice
- Use Optional as a return type and never as a field or parameter
- Use pattern matching for instanceof and switch to replace casts and visitors
- Explain what a virtual thread is, what it is not, and when it changes a design
Curriculum
14 lessons · outlined lessons show their plan01
Lambdas and functional interfacesWhat a lambda compiles to, the four core functional interfaces, method references, and effectively-final variables.12 minStreamsPipelines, laziness, intermediate versus terminal operations, collectors, and the parallel stream you should not reach for.12 minOptionalA return type that says "maybe", the API that makes it readable, and the three misuses that make it worse than null.9 minPure functions and immutabilityMemoising an impure function silently gave 5 5 5 where the program meant 5 10 15. And an immutable object seen half-updated: never.12 minComposition and higher-order functionsPassing behaviour instead of flags, and the ordering trap: andThen gave 21 and compose gave 17 from the same two functions.11 minWriting a CollectorFour functions, and the combiner that only runs in parallel — so a broken one passes every sequential test.10 minDate and timejava.time: Instant, LocalDateTime, ZonedDateTime, Duration and Period — and why Date and Calendar are never the answer.11 minJava 8: functional Java
02
var, text blocks and the HTTP clientLocal type inference done responsibly, multi-line strings without escapes, and the standard HTTP client that replaced HttpURLConnection.10 minPattern matchinginstanceof patterns, switch patterns, record deconstruction and guards — the features that make sealed hierarchies worth having.11 minJava 11 to 17
03
Virtual threadsThreads that cost almost nothing to block: how Loom works, where it changes a design, and the pinning and pooling mistakes that undo it.12 minSequenced collections and what is newSequenced collections, unnamed variables, string templates that came and went, and how to read a JEP.9 minThe module systemWhy 8 to 11 is the hard upgrade, what `public` stopped meaning, and the honest answer to whether you should modularise — usually no.12 minUpgrading across an LTSThe best argument is not a feature: it is a NullPointerException that names which of four dereferences was null.12 minPreview, incubator, removedStructured concurrency is still preview on Java 25, and the Java 21 code does not compile there. That is what "may change" means.11 min