public static <E extends Number> List<? super E> check(List<E> list)
{
return null;
}
public static void main(
String... a)
{
//Line 1
//Line 2
output = check(input);
}
List<Integer> input = null;
List<Integer> output = null; // Case 1
OR
List<Number> input = null;
List<Number> output = null; // Case 2
Why inserting the above for Line 1 & Line 2 does not work......?
Here my doubt is that in case of return typ for the above function
List<? super E> if I take the input as above say case 1 then E is Integer
so the return type becomes List<? super Integer>
so here if I return List<Integer> output; then it should also work..
I am really confused with List<? super Integer>
If I am correct it means List of Integer/List of anything that is super class of Integer...
Please help............