Generics - You Never Know What You're Gonna Get by Bram Janssens

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A conference talk demystifying Java generics through a Forrest Gump-themed story. Covers type erasure (why the JVM doesn't actually know generics), why primitive types can't be used as type arguments, wildcard capturing, and the three variance modes: invariance (default), covariance (? extends), and contravariance (? super). Introduces the PECS mnemonic (Producer Extends, Consumer Super) and warns that arrays are covariant but not type-safe, which can cause runtime exceptions.

15m watch time

Sort: