Table of contents
The Curriculum
Nine lessons across five chapters. Read them in order if you are new, or dip in where you need to. Every lesson is self-contained and includes runnable code.
01
Foundations
§ 1.0112 min§ 1.0218 min§ 1.0320 min
Hello, World — your first Java program
Set up the JDK, understand the anatomy of a Java class, and run a program from the command line.
Variables, primitive types, and references
The eight primitive types, the difference between values and references, and how the compiler infers types.
Control flow: if, switch, and loops
Branching and iteration, including modern switch expressions and the enhanced for loop.
02
Object-Oriented Java
§ 2.0125 min§ 2.0228 min
Classes, fields, constructors, methods
Model the world with classes — encapsulation, constructors, the `this` reference, and method overloading.
Interfaces, abstract classes, inheritance
Polymorphism done right — when to extend, when to implement, and why composition usually wins.
03
Collections & Generics
05
Data Structures in Java
§ 6.0122 min§ 6.0220 min§ 6.0324 min§ 6.0428 min§ 6.0526 min§ 6.0622 min§ 6.0730 min§ 6.0822 min§ 6.0928 min§ 6.1026 min§ 6.1124 min§ 6.1218 min
Arrays and ArrayList — the workhorses
Fixed-size arrays vs dynamic ArrayList. Memory layout, amortized O(1) append, and when each one shines.
LinkedList and the Deque interface
Doubly-linked nodes, O(1) insert at either end, and why LinkedList is almost never the right choice.
Stacks, queues, and ArrayDeque
LIFO, FIFO, and why java.util.Stack is a historical mistake you should avoid.
HashMap, equals, and hashCode
How hashing works, why you must override equals and hashCode together, and the load factor that keeps lookups O(1).
TreeMap, TreeSet, and ordered structures
Red-black trees under the hood. O(log n) sorted access, range queries, and floor/ceiling lookups.
PriorityQueue — heaps in disguise
Binary heaps, O(log n) insert and extract-min, and the canonical k-largest pattern.
Graphs — adjacency lists and BFS
Modeling graphs in plain Java with Map<Node, List<Node>>, then walking them breadth-first.
HashSet and LinkedHashMap — uniqueness and order
Deduping in O(1), preserving insertion order, and building an LRU cache in 6 lines.
Binary Search Trees from scratch
Build a BST, understand insert and search, and see why balance is everything.
Tries — prefix search and autocomplete
A tree keyed by character. Autocomplete, spellcheck, and IP routing tables all live here.
Union-Find (Disjoint Set)
Track connected components in near-constant time with path compression and union by rank.
Immutable and unmodifiable collections
List.of, Map.copyOf, Collections.unmodifiableList — knowing which is which prevents subtle bugs.