Tag Archives: collections

Java and Generics

I’ve been brushing up on Java a bit lately, and came across the topic of generics. While I’ve consumed generic classes, primary collections, I’ve only created a generic class a few times. It’s really quite fascinating, in particular when you get to the concept of upper and lower bounds for generic types.

Type erasure in Java is also quite intriguing… the end result being that the Java runtime knows nothing about generics.

I’m reading “Learning Java” 4th Edition, and while there might be a newer version, I still highly recommend it for reviewing generics.