I can't find an answer so...
I have read the post Difference between <? super T> and <? extends T> in Java and understood that instance of List<? super Number>
can return only Object
type and that is true.
But if I try to use a super wildcard with Consumer
like this
Consumer<? super Number> consumerNum = n -> System.out.println("number " + (n.intValue() + 200));
Variable n is Number
not Object
!
Why?
I can't understand.