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<Integer> into a parameter of type List<Number>? 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.
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<Integer> into a parameter of type List<Number>? 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.
Bram Janssens
Info Support
Hello, I'm Bram Janssens, a software engineer and teacher from the Netherlands. I work as a trainer/consultant at Info Support, where I teach Java and other programming languages to professionals.
I studied Computer Science at the University of Twente, followed by a one-year university teacher training program to become a mathematics teacher. Throughout my career, I’ve alternated between teaching and software engineering—but at heart, I consider myself a teacher. I enjoy helping others, explaining complex topics clearly, and making a meaningful difference.
My motto: "Actually, it’s quite simple!"
While I'm happy to support others in any subject, my technical expertise lies in Java, thanks to years of hands-on experience. I'm also enthusiastic about Kotlin and enjoy exploring its modern features.
In my free time, I enjoy playing tennis, doing pub quizzes, brewing beer, and umpiring at the national level for the Dutch baseball association.
Digital business card: bramjanssens.nl
I studied Computer Science at the University of Twente, followed by a one-year university teacher training program to become a mathematics teacher. Throughout my career, I’ve alternated between teaching and software engineering—but at heart, I consider myself a teacher. I enjoy helping others, explaining complex topics clearly, and making a meaningful difference.
My motto: "Actually, it’s quite simple!"
While I'm happy to support others in any subject, my technical expertise lies in Java, thanks to years of hands-on experience. I'm also enthusiastic about Kotlin and enjoy exploring its modern features.
In my free time, I enjoy playing tennis, doing pub quizzes, brewing beer, and umpiring at the national level for the Dutch baseball association.
Digital business card: bramjanssens.nl 