Interview Questions

What is generic erasure?

When we implement the generics in a java program, then compiler does the following things

1. Type casting is done if necessary to preserve type safety.
2. Compile erases all the type information at bytecode level.
3. Once compiled at bytecode level, raw and generic types are same.