Forums Register Login

Generic doubts

+Pie Number of slices to send: Send


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!
+Pie Number of slices to send: Send
Hi,

Did you see K&B errata:

K&B Errata


Thanks,
+Pie Number of slices to send: Send
Try the following:


[ July 05, 2007: Message edited by: Sergio Tridente ]
I'm gonna teach you a lesson! Start by looking at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 604 times.
Similar Threads
doubt abt Generics mock question - from K&B
wildcards in generics
A Generic Question. Thanks.
About Chapter 7: Generics and Collections
K & B Generics Quiz question.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:47:17.