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?
About Question com.enthuware.ets.scjp.v6.2.88 :
Moderator: admin
-
- Posts: 50
- Joined: Sun Nov 10, 2013 4:39 am
- Contact:
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.88 :
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
You might want to go through this: viewtopic.php?f=2&t=473
Who is online
Users browsing this forum: No registered users and 5 guests