Hi guys,
I'm having problem with question 16 in chapter 7(Generics).
Given a method declared as:
public static <E extends Number> List<? super E> process(List<E> nums) And
// INSERT DECLARATIONS HERE
output = process(input); Why is the following declaratin wrong?
ArrayList<Integer> input = null;
List<Number> output = null; Assumed <E> resolves to <Integer>.
Then the return type List<? super E> could be resovled to List<Number> since Number is the ancestor of Integer.
So what is wrong about this?
Please, I'm not getting this
Thank you very much!
Arsineh