Java course
A practical course that goes from installing a JDK to three capstone projects. Every lesson is a
manual: a complete program, the command that builds it, and the output it printed on the machine
described at the end of the lesson. The course is written and published part by part: the cards
below open the parts, and the tree lists the lessons that are ready to read.
Types and control flow come first, then methods and text, classes and objects, and the part of the
language that changed most in recent years: records, sealed types and pattern matching. Collections
and streams follow, then exceptions, files, threads and the JVM itself. The last part builds a JSON
writer, a task tracker and a small HTTP service, one lesson at a time.
Start with
What Java is and where it runs .
For a short description of the language read
Java basics , and to put a JDK on your machine open
the install guide for your system .
Java course: Getting started
The JDK on the machine, the first program built and run, warnings, packages and jshell.
Open →
Java course: Types, operators, conditions and loops
The eight primitives, numbers and casts, the operators, conditions, switches, loops, methods and recursion.
Open →
Java course: Methods, arrays, strings and text blocks
Arrays and the algorithms over them, String and StringBuilder, formatting, text blocks, wrappers, BigDecimal and args.
Open →
Java course: Classes and objects
Classes, constructors, static, encapsulation, equals and hashCode, immutability, nested classes, enums and composition.
Open →
Java course: Inheritance, interfaces, records and sealed types
Inheritance and polymorphism, interfaces, Object, records, sealed types and pattern matching.
Open →
Java course: Generics and collections
Generics, erasure, List, Set, Map, Deque, Comparable, Comparator and the iteration that removes.
Open →
Java course: Lambdas, streams and Optional
Lambdas, the functional interfaces, method references, streams, collectors and Optional.
Open →
Java course: Exceptions, resources and assertions
Checked and unchecked exceptions, try-with-resources, causes, stack traces, assertions and Error.
Open →
Java course: Text and I/O
Scanner, files, Path, bytes, charsets, java.time, formatters, regular expressions and a CSV file.
Open →
Java course: Concurrency
Threads, shared state, executors, futures, atomics, locks, concurrent collections, CompletableFuture and virtual threads.
Open →
Java course: Memory, the JVM, packaging and tooling
The heap and the collector, modules, jar and javadoc, JUnit and the three linters with Maven.
Open →
Java course: Capstone projects
A JSON writer, a task tracker and an HTTP service, each built lesson by lesson.
Open →
All articles
course/
Getting started (7)
Types, operators, conditions and loops (12)
Methods, arrays, strings and text blocks (14)
Classes and objects (14)
Inheritance, interfaces, records and sealed types (18)
Generics and collections (16)
Lambdas, streams and Optional (14)
Exceptions, resources and assertions (8)
Text and I/O (10)
Concurrency (10)
Memory, the JVM, packaging and tooling (5)
Capstone projects (7)