I cannot provide a better or less formal explanation of what the document is for type erasure. In your case (Class casting) "If T is a class type, then either | S | <: | T | or | T | <: | S |. Otherwise, a compile-time error occurs." means that after the type is erased, the cast class is legal if the arguments of the general type are in the "subclass class relation". A simple example:
static class Bar {} static class FooBar extends Bar {} public static void main(String[] args) { List<FooBar> foobarList = (List<FooBar>) newList(Bar.class); List<Bar> barList = (List<Bar>) newList(FooBar.class); System.out.println("No cast class exception :)"); } private static<T> List<?> newList(Class<T> clazz) { return new ArrayList<T>(); }
source share