Java Generics and Erasure

February 1, 2012

Generics or the parametrized types are compile time constructs in Java. This means that these do exist in JVM byte code. The process of converting parametrized types to bytecode that is backward compilable with older java code is called Erasure. This can also be called Type Erasure.

Sometimes during compilation, JVM may need to add a bridge method to perform type erasure.