What I don not understand is why Java allows this
Generic<Integer> lonelyObject=new Generic<Integer>();
and not this:
Genericd<Integer>[] arrayObject= Generics<Integer>[10];
If the second one looses type safety due to invariance, shouldn't the first be the same?
Thanks for all the replies! I understand why it does not allow arrays to be created, because they contain type info at runtime and due to type erasure there are none for Generics at runtime, but how does this violates type safety and creating a simple object doesn't?
Could somebody please explain.