Grokking Generics

Categories: Java, JDK, SDK, Generics

For those still grappling with Generics? This will be an attempt to clear the air about generics. What are wildcards? What is extends? What is super? What is covariance? What is contravariance? What is invariance? What is erasure? Why and when do I need this?

One of the more pain items in any statically typed language on the JVM is generics or parameterized type. This presentation is set to overcome some of these hurdles and understand some of these terms that often vex us. We will cover:

  • Covariance

  • Contravariance

  • Invariance

  • Erasure

  • Generic Assignments

  • Weird Generic Funky Stuf

  • Use-Site vs Declaration-Site Variance

  • Differences Java vs. Scala vs. Kotlin