public static <T extends Comparable<? super T>> void sort (List<T> list)的理解
public static <T extends Comparable<? super T>> void sort (List<T> list)
(1)首先:public static void sort(List list)
(2)为了安全性加泛型:public static <T> void sort(List<T> list)
(3)想要排序先比较,要有可比较性,因此T必须是Comparable的子类:public static <T extends Comparable> void sort(List<T> list)
(4)Comparable接口也有泛型:public static <T extends Comparable<T>> void sort(List<T> list)
(5)T的父类也行,<? super T>表示Comparable<>中的类型下限为T:public static <T extends Comparable<? super T>> void sort (List<T> list)
public static <T extends Comparable<? super T>> void sort (List<T> list)的理解
原文:http://blog.csdn.net/sjtu_chenchen/article/details/45227959