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 Generic doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Generic doubts" Watch "Generic doubts" New topic
Author

Generic doubts

wong sheena
Greenhorn

Joined: Apr 07, 2007
Posts: 23


The explanation is given as from k&B:
C is wrong because the return type evaluates to List<Integer>, and that can't
be assigned to a variable of type List<Number>.

how do we evaluate the type to be <Integer> as explained by the book??
and how come the option C is wrong. (Note other option are removed.)

Thanks!
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi,

Did you see K&B errata:

K&B Errata


Thanks,


cmbhatt
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

Try the following:


[ July 05, 2007: Message edited by: Sergio Tridente ]

SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generic doubts
 
Similar Threads
About Chapter 7: Generics and Collections
A Generic Question. Thanks.
doubt abt Generics mock question - from K&B
K & B Generics Quiz question.
wildcards in generics