File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ? extends Number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "? extends Number" Watch "? extends Number" New topic
Author

? extends Number

Raju Champaklal
Ranch Hand

Joined: Dec 10, 2009
Posts: 521
when we have a List<? extends Number> and use get() to get the elements from the list what do we get? Number or Objects?


scjp 1.6 91%, preparing for scmad
"Time to get MAD now.. we will get even later"....by someone unknown
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Did you try to see what it returns Number or Object??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Raju Champaklal wrote:when we have a List<? extends Number> and use get() to get the elements from the list what do we get? Number or Objects?

anything extends number.


Rajeev Kumar
SCJP 6.0 Certified 96%
Raju Champaklal
Ranch Hand

Joined: Dec 10, 2009
Posts: 521
ya i tried....it gave me Number..i tried it after posting the question
 
jQuery in Action, 2nd edition
 
subject: ? extends Number
 
Similar Threads
generics extends question?
Generics
A question from the Master Exam CD (generics)
Wild card ? extends Number in return of a method ?
Reference assignment involving Generics and hierarchy- Niko's Blog