摘要: Comparable 是排序接口,一个类实现了comparable接口,就意味着 该类支持排序, List<该类> 可以通过 Collections.sort() 或者 Arrays.sort() 进行排序 此外,实现Comparable接口的类 可以用作 有序影射(如 TreeMap)中的 key 阅读全文
posted @ 2016-06-30 15:55 morningdew 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Array.sort() 1. Arrays.sort(int[] a): 从大到小的排序 2. Arrays.sort(int[] a, int fromIndex, int toIndex): 从大到小的排序 3. public static<T> void sort(T[] a, int fr 阅读全文
posted @ 2016-06-30 15:31 morningdew 阅读(206) 评论(0) 推荐(0) 编辑