If it was allowed, you could end up relying on a list, which is an ArrayList at some point, and somewhere else.
For example, this would also be legal for this:
ArrayList<ArrayList<String>> arrayLists = new ArrayList<ArrayList<String>>(); List<List<String>> unknownLists = arrayLists ; unknownLists.append(new LinkedList<String>()); for (ArrayList<String> l : arrayLists )
This will compile fine, but you will get a ClassCastException in (1).
source share