List<Long> listLong = new ArrayList<Long>();
List<Number> listNumbers = listLong;
So, listNumbers
and listLong
would be two references to the same list, if that was possible, right?
listNumbers.add(Double.valueOf(1.23));
So, you would be able to add a Double to that list. listLong
, of type List<Long>
, would thus contain a Double. The type-safety would thus be broken.