Table of contents
The Curriculum
Nine lessons across five chapters. Read them in order if you're 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
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.