Java - illegal generic array

less than 1 minute read

The following code will have a compile error

1
new List<E>[];

The reason is that it is not a typesafe. It will violate the generic type system in Java