← Java Toolkit · guided lesson

Java Toolkit & Collections

1 / 18 · story

the story

The Collections Framework

Every tool here exists because something was too slow or broke without it. Here is what.

1998 · Joshua Bloch (design lead) and the JDK team at Sun Microsystems

Early Java had arrays, Vector and Hashtable, with no shared interface between them. JDK 1.2 (renamed Java 2, shipped December 1998) added the Collections Framework: interfaces like List, Set and Map, plus ready-made implementations behind them. Joshua Bloch led its design. The old Vector and Hashtable were retrofitted to fit the new interfaces.

the problem it solved

Every library invented its own containers, so code couldn't pass collections around, or swap a slow implementation for a faster one without a rewrite.

why it matters: without it

Every solution would start with a hand-written hash table or heap, and every library would speak its own container dialect.

sources: Collections Framework Overview (Oracle) ↗ · OpenJDK source: java.util.Collection (@author Josh Bloch, Neal Gafter; @since 1.2) ↗ · Joshua Bloch, author bio (InformIT) ↗ · LWN, 10 Dec 1998: JDK 1.2 ships as the Java 2 Platform ↗

also in this chapter: ArrayList (dynamic array) · HashMap & HashSet (hash table) · ArrayDeque (ring buffer) · PriorityQueue (binary heap) · TreeMap & TreeSet (red-black tree) · Autoboxing & the Integer cache