posted 15 years ago
which can be inserted
A.List<List<Integer>> table = new List<List<Integer>>();
B.List<List<Integer>> table = new List<ArrayList<Integer>>();
C.List<List<Integer>> table = new ArrayList<ArrayList<Integer>>();
D.List<List,Integer>> table = new List<List,Integer>>();
E.List<List,Integer>> table = new ArrayList<List,Integer>>();
F.List<List,Integer>> table = new ArrayList<ArrayList,Integer>>();
G.none
Why is c wrong? Given explanation "the type argument <List<Integer>> must be the same on both sides of the assignment even though the constructor new ArrayList() on the right side is a subtype of the declared type List on the left side." Why does the type arg have to be the same?
Thanks