2014年9月20日

sort()与Comparable接口

摘要: sort()一般用于 对象 数组或者List类(Set不可)排序,需要类实现Comparable接口void static sort(List list)根据元素的自然顺序 对指定列表按升序进行排序是属于Collections类的一个静态方法,也就是说可以这样调用:int[] a={.....}; ... 阅读全文

posted @ 2014-09-20 12:43 平庸 阅读(206) 评论(0) 推荐(0) 编辑

导航