이유는 다음과 같은 ArrayList<List<Integer>>
내로 ArrayList<ArrayList<Integer>>
를 할당 할 수 없습니다 : ArrayList에와 할당 ArrayList를 <리스트 <Integer>><ArrayList를이 <Integer>>
ArrayList<List<Integer>> x = new ArrayList<ArrayList<Integer>>();
모든 ArrayLists 목록이 아니므로 나는 목록을 어디에 넣을 수 있습니다 , 나는 또한 ArrayList를 배치 할 수 있습니까?
ArrayList<ArrayList<Integer>> y = new ArrayList<>();
ArrayList<List<Integer>> x = y; // Compiler error! Pretend it's OK, though.
x.add(new LinkedList<>()); // Fine, because a LinkedList<Integer> is a List<Integer>
을하지만, 다음이 실패 :이 합법적 인 경우