Code:
List<Number> li1 = ..; List<Integer> li2 = ..; li1 = li2; //[B]li1[/B] can't be subtype of [B]li2[/B]
Then ..
Code:
List<?> li1 = ..; li1 = li2; //it's valid
Code:
List<? extends Number> li1 = ..; li1=li2; //it's also valid
So with the valid codes li1 can't be updated. Then why ? extends SuperClass. What's the problem with first code fragment?
Comment