Generics - You Never Know What You're Gonna Get
summary
Shows that Java generics are a compile‑time illusion: JVM erases generics so T becomes Object and primitive type arguments fail (List<byte>). Demonstrates wild‑card capture of ? errors, why add(capture of ? extends A) is rejected, and how producer extends / consumer super controls read vs write. Builds small Box<T>/Candy model, compiles and runs examples, and exposes the surprise that arrays are covariant at runtime and can throw ClassCastException.
AI-written summary · about
