Page 1 of 1

About Question com.enthuware.ets.scjp.v6.2.88 :

Posted: Sun Feb 16, 2014 9:19 am
by devlam
Why with List<? super Number> does allow only retrieving Object-instances. Why not also Number-instances?
I understand you cannot retrieve subclasses of Number but why not Number itself?

Re: About Question com.enthuware.ets.scjp.v6.2.88 :

Posted: Sun Feb 16, 2014 9:27 am
by admin
Because all you know is that the list contains objects of some class for which Number is-a that class is true. It could be Number itself but you are not sure. It could be some other class as well. That is why you can't take Number out of such a list.

You might want to go through this: viewtopic.php?f=2&t=473