Possible Duplicates:
How to Cast a Vector<ObjectA> to Vector<ObjectB> in Java?
IsList<Dog>
a subclass ofList<Animal>
? Why aren't Java's generics implicitly polymorphic?
I've a logical problem with the java type casting.
I have a class A which extends class B and therefore I can have a statement like
A a = new B();
but why I get a compiler error for Vector<A> va = new Vector<B>();
or Vector<A> va = (Vector<A>)new Vector<B>();