import java.util.*;
class A {}
class B extends A {}
class B1 extends A {}
class B2 extends A {}
class C1 extends B {}
class C2 extends B {}
public class AsListInt {
public static void main(String[] args) {
1. List<A> list1 = Arrays.asList(new B(), new B1(), new B2());
2. List<A> list2 = new ArrayList<A>();
3. Collections.addAll(list2, new C1(), new C2());
4. List<A> list3 = Arrays.asList(new C1(), new C2());
}
}
Login in to like
Login in to comment