Uploaded April 2026 | Updated September 2026, 2 weeks ago
Please subscribe to our YouTube channel @ youtube.com/@DevoxxForever
Subscribe to LinkedIn @ linkedin.com/company/voxxed-days-amsterdam
Follow us on Twitter @ twitter.com/voxxedamsterdam
You might think Java is type-safe, but did you know you can *break* type safety too? It all comes down to variance: co-, contra-, and invariance.
Maybe you’ve heard of these terms, but you’re not entirely sure what they mean or how to use them effectively. That was exactly my situation — even after more than ten years of experience with Java. I’ve noticed this same knowledge gap among the students I teach.
Type safety gives us reliability but also adds complexity compared to weakly, dynamically typed languages. Why do we even have types? What makes something a subtype? Do you think you can pass an Integer into a parameter of type Number? And what about a “type that has a type”? Generics are Java’s way of handling such cases, but they can introduce unexpected and sometimes seemingly illogical behavior. For example: Can you pass a List into a parameter of type List? What is a capture, and why do you sometimes see errors like "add(capture of ? extends A) cannot be applied to S"?
In this talk, I’ll demystify these concepts and explain them in a way you’ll never forget. You’ll impress your colleagues, gain a competitive edge, and be better prepared to understand and write reusable (framework) code.
Please subscribe to our YouTube channel @ youtube.com/@DevoxxForever
Subscribe to LinkedIn @ linkedin.com/company/voxxed-days-amsterdam
Follow us on Twitter @ twitter.com/voxxedamsterdam
You might think Java is type-safe, but did you know you can *break* type safety too? It all comes down to variance: co-, contra-, and invariance.
Maybe you’ve heard of these terms, but you’re not entirely sure what they mean or how to use them effectively. That was exactly my situation — even after more than ten years of experience with Java. I’ve noticed this same knowledge gap among the students I teach.
Type safety gives us reliability but also adds complexity compared to weakly, dynamically typed languages. Why do we even have types? What makes something a subtype? Do you think you can pass an Integer into a parameter of type Number? And what about a “type that has a type”? Generics are Java’s way of handling such cases, but they can introduce unexpected and sometimes seemingly illogical behavior. For example: Can you pass a List into a parameter of type List? What is a capture, and why do you sometimes see errors like "add(capture of ? extends A) cannot be applied to S"?
In this talk, I’ll demystify these concepts and explain them in a way you’ll never forget. You’ll impress your colleagues, gain a competitive edge, and be better prepared to understand and write reusable (framework) code.










