General maximum function in Java

public static <T extends Comparable<? super T>> T max(List<? extends T> coll){ // return max; } 

I understand why <T extends Comparable<? super T>> <T extends Comparable<? super T>> makes sense. But I'm not sure why the argument is List<? extends T> coll List<? extends T> coll important.

Why is List<T> coll insufficient?

+5
source share

Source: https://habr.com/ru/post/1273053/


All Articles