Inside java.util.Collections we have the below method signature
public static <T> void sort(List<T> list, Comparator<? super T> c)
I don't understand why one would specify
Comparator<? super T>
instead of
Comparator<T>
Which use cases does it cover?
` does just fine for comparing `T` objects - and this signature reflects that.– Dawood ibn Kareem Aug 04 '18 at 04:33