Consider
List<? super Integer> lst= new ArrayList<Number>();
lst.add(new Integer(3)); //ok- why?? I expected compile error "expected add(int, Object), found add(int,CAP#1)"
lst.get(0); //ok
and
List <? extends Number> nums= new ArrayList<Integer>();
lst.add(new Integer(3));//Compile error- expected add(int, Object), found add(int,CAP#1)
On the compile state we dont know about type of <? extends Number>
and have compile error. Does we know about type of <? super Integer>
on compile state? Why?