I want to know if there are any logical differences in declaration of these two methods:
exemple 1
public static <T extends Comparable<? super T>> T findMax(List<? extends T> list)
exemple 2
public static <T extends Comparable<? super T>> T findMax(List<T> list)
Someone told me that this part <? extends T>
is equivalent with <T>
and the wildcard is redundant in first exemple, and he suggested me to use the code from the second exemple. Is that right?