• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

K & B Generics Self Test Q16

 
palla sridhar
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i try to compile the following code, i get a COMPILER ERROR.



The answers given are:


Can anyone explain why these answers give a COMPILER ERROR still ??. My doubt is how can List<Integer> or List<Number> be assigned a List<? super Integer> or List<? super Number>.....
 
ahmed yehia
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See K&B errata, the correct signature is:
 
palla sridhar
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ahmed, for showing the Error and also let me know abt the Errata..
Can you tell me the link where i can get proper ERRATA for K&B. In javaranch, its not so clear..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic