I am trying this -
List<? extends Integer> l = new ArrayList<Integer>();
l.add(10);
and compiler says -
The method add(int, capture#1-of ? extends Integer) in the type List<capture#1-of ? extends Integer> is not applicable for the arguments (int)
Why i am not able to add an integer to a List of Integer, Why compiler is not complaining at first line itself if i will not be able to add integers?