thepointman.dev_

Courses / Java Language

Java Generics

intermediate13 lessons

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

  1. 01

    The Pre-Generics Dark Age — Raw Types and ClassCastException Hell

    soon
  2. 02

    Generic Classes and Methods — The Syntax Made Sensible

    soon
  3. 03

    Bounded Type Parameters — extends, super and Multiple Bounds

    soon
  4. 04

    Type Erasure — What Actually Survives to Runtime

    soon
  5. 05

    Bridge Methods — The Compiler's Erasure Workaround in Bytecode

    soon
  6. 06

    Invariance — Why List<Dog> Is Not a List<Animal>

    soon
  7. 07

    Covariance with ? extends T — Read-Only Flexibility

    soon
  8. 08

    Contravariance with ? super T — Write-Side Flexibility

    soon
  9. 09

    PECS — Producer Extends, Consumer Super as a Practical Rule

    soon
  10. 10

    Generic Limitations — new T(), instanceof, Primitive Types, Arrays

    soon
  11. 11

    Heap Pollution and @SafeVarargs — The Varargs Danger

    soon
  12. 12

    Reflection and Generics — ParameterizedType and Type Tokens

    soon
  13. 13

    Advanced Patterns — Recursive Generics, CRTP and Generic Builders

    soon