public void arrayTest(List<T> list) {
T[] array = new T[list.size()];
}
because you're not allowed to create generic arrays. This has to do with the way Sun implemented Generics by preserving a significant amount of backward compatibility and by dropping the type safety once the source is compiled. In other words, these two statements generate the same bytecode:
List<String> list = new ArrayList<String>();
List list = new ArrayList();
I have a way to go before I can make any determinations, but I'm not particularly pleased with this.
No comments:
Post a Comment