posted 17 years ago
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 DECLARATION HERE
output = process(input);
which pairs of declaration 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> input = 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.
Which answer is true and Why? the More particular,the better.
Thanks very much!