HI all,
k&b pg 621
-----------------------------------------------------------------------------
Given a method declared as
public static <E extends Number> List<E> process(List<E> nums)
// INSERT CODE HERE
output = process(input);
Which pairs of declarations could be placed at // INSERT CODE HERE
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
---------------------------------------------------------------------------------
As per K&B book ans:-B,E,F
but i think 'A' also correct because return type follows
polymorphism so if
return type is ArrayList also it can handle by List,Is it correct?