| Author |
SCJP 5 K&B question problem
|
Abdul Mohsin
Ranch Hand
Joined: Apr 26, 2007
Posts: 111
|
|
Has anybody tried running question 16th of chapter 7 kathy Sierra? Given a method declared as: public static <E extends Number> List<? super E> process(List<E> nums) A programmer wants to use this method like this: // INSERT DECLARATIONS HERE output = process(input); Which pairs of declarations could be placed at // INSERT DECLARATIONS HERE to allow the code to compile? (Choose all that apply.) A. ArrayList<Integer> input = null; ArrayList<Integer> output = null; B. ArrayList<Integer> input = null; List<Integer> output = null; C. ArrayList<Integer> input = null; List<Number> output = null; D. List<Number> input = null; ArrayList<Integer> output = null; E. List<Number> input = null; List<Number> output = null; F. List<Integer> input = null; List<Integer> output = null; G. None of the above. According to book B, E, and F are correct. but I tried and found none of them are correct Please help me
|
Regards, Abdul Mohsin
|
 |
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
Actually it is, public static <E extends Number> List<E> process<List<E> nums) See the link K&N errata top of this forum! Thanks, cmbhatt
|
cmbhatt
|
 |
 |
|
|
subject: SCJP 5 K&B question problem
|
|
|