Foundation
Collections and Generics
Pick the right structure; know what it costs.
The Collections Framework by the decisions it forces — which List, which Map, which Set — with the complexity, the memory and the iteration behaviour of each, and generics deep enough to write and read a bounded wildcard.
9 lessons written2 modules~2h reading
After this course you can
- Choose the right collection for an access pattern and defend the choice with its complexity
- Explain how HashMap works, why load factor matters, and what a bad hashCode does to it
- Read and write generic methods with bounded types and wildcards (PECS)
- Avoid ConcurrentModificationException, unmodifiable-view surprises and boxing costs
Curriculum
9 lessons · outlined lessons show their plan01
The Collections FrameworkCollection, List, Set, Queue, Deque, Map — the interfaces, the implementations, and the one table you should carry in your head.10 minLists: ArrayList vs LinkedListWhy ArrayList wins almost every time, what amortised O(1) means, and the one workload where LinkedList is not a mistake.11 minHashMap internalsBuckets, hashing, treeification at eight collisions, resize, load factor, and iteration order that is not a contract.12 minSets, TreeMap and orderingHashSet, LinkedHashSet, TreeSet, TreeMap, Comparable versus Comparator, and the consistency rule that makes a TreeSet lose elements.9 minQueues, deques and priority queuesArrayDeque as the stack you should use, PriorityQueue as a heap, and the blocking queues that concurrency will need.11 minIterators and IterableWhat for-each compiles to, the modCount check behind ConcurrentModificationException, and how to write a class the language can loop over.11 minComparable and ComparatorNatural order versus imposed order, comparator chaining, and the contract violations that make a sort throw or a TreeMap lose entries.12 minThe framework
02
Generics fundamentalsType parameters, type erasure, why you cannot new T(), raw types, and the unchecked warning you should not suppress.9 minBounded types and wildcardsextends, super, PECS, and how to read List<? super Integer> without guessing.9 min