Java Is Unsound: The Industry Perspective
&quot;So had history been a little different, either with Sun deciding to throw out backwards compatibility after adding generics, or with Sun adding generics into the JVM, or with Java first being released with generics, then this exception would not be thrown&quot;<p>It returns a ClassCastException because underneath it all, in the Java bytecode the Java compiler stores generics as casts.  Therefore it will complain because it can&#x27;t cast.  If they had baked generics in at the beginning of Java then it wouldn&#x27;t have compiled.<p>It would be the equivalent of writing String one = 1;