Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this Generics model answer correct

 
sam Asare
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Studying for SCJP5 using Sierra/Bates book.

In generics end of ch question 16 has the answer as below. However I am not sure its correct.

public static <E extends Number> List<? super E> process(List <E>

//if you want to invoke the method like this
ArrayList<Integer>input=null
List<Integer>output=null

output=process(input)//will this invocation work with the above 2 lines?

//I thought the process method requires a list as input.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic