The complete generics story: type erasure, bridge methods, invariance vs covariance vs contravariance, wildcards, PECS, heap pollution, @SafeVarargs, reflection with ParameterizedType, and advanced patterns like recursive generics and generic builders. No shortcuts.
// Lessons
- 01soon
The Pre-Generics Dark Age — Raw Types and ClassCastException Hell
- 02soon
Generic Classes and Methods — The Syntax Made Sensible
- 03soon
Bounded Type Parameters — extends, super and Multiple Bounds
- 04soon
Type Erasure — What Actually Survives to Runtime
- 05soon
Bridge Methods — The Compiler's Erasure Workaround in Bytecode
- 06soon
Invariance — Why List<Dog> Is Not a List<Animal>
- 07soon
Covariance with ? extends T — Read-Only Flexibility
- 08soon
Contravariance with ? super T — Write-Side Flexibility
- 09soon
PECS — Producer Extends, Consumer Super as a Practical Rule
- 10soon
Generic Limitations — new T(), instanceof, Primitive Types, Arrays
- 11soon
Heap Pollution and @SafeVarargs — The Varargs Danger
- 12soon
Reflection and Generics — ParameterizedType and Type Tokens
- 13soon
Advanced Patterns — Recursive Generics, CRTP and Generic Builders