The signature of java.util.Collections.max looks like this:
public static <T extends Object & Comparable<? super T>> T max(Collection collection);
From what I understand, it basically means that T must be both a java.lang.Object and a java.lang.Comparable<? super T>>,
However, since every java.lang.Comparable is also an java.lang.Object, what is the difference between the signature above and this below? :
public static <T extends Comparable<? super T>> T max(Collection collection);
To preserve binary compatibility: It’s completely described here. The second signature actually changes the return type of the method to
Comparableand it loses the generality of returning anObject. The original signature preserves both.