考虑静态实用程序中的通用min
方法,该方法旨在返回 set 中的最小元素。为什么我们需要将其声明为
public static <T extends Comparable<? super T>> T min(Set<? extends T> producerSet)
如果我们改为将其声明为
public static <T extends Comparable<T>> T min(Set<? extends T> producerSet)
type 参数中的通配符类型在这里给了我什么灵活性?