Java Generic Array Creation Error
Java Generics are a neat hack to save some typing. They have a bunch of problems though. Most of these are due to the lack of runtime type information. Today a friend asked why you can’t create do:
new ArrayList<String>[10]
The compiler gives the error error: generic array creation.
Following is a short explanation of what generics can and cannot do in Java.
Comments Off on Java Generic Array Creation Error