Generics and interface

Ok let's say I have an Interface A

I have a Class B whom extends A.

In another class, I have private member :

List<A> xyz;

In a method, I receive (List<B> listabc);

I want to have in xyz a reference to all listabc items, what is the best way to do it? Cast doesn't work, so I have to iterate on abc ?

Thanks.

[365 byte] By [JF_La] at [2007-10-3 4:01:12]
# 1
Change xyz to List<? extends A>
ejpa at 2007-7-14 22:00:24 > top of Java-index,Core,Core APIs...