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.
this is a question from KS&BB, chapter 7 self
test q#16.The answer given is B,E and F...which i think i understand, however i cannot see why C is also not right??please help..thank you!