What is the difference between this method declaration:
public static List process(List nums){
a
The first allows process of a List, a List, etc. The second doesn't.
Generics in Java are invariant. They're not covariant like arrays.
That is, in Java, Double[] is a subtype of Number[], but a List is NOT a subtype of List. A List, however, is a List extends Number>.
There are good reasons for generics being invariant, but that's also why the extends and super type are often necessary for subtyping flexibility.
super and extends for bounded wildcardsextends Consumer super" principle