
The Java Generics is based on Erasure, which means the type check is only done at compile time, and at runtime the type information is erased.
The following code will throw an ClassCastException, because there is no way the JVM can check the cast at runtime.
public static void main(String[]...