Collections中集合的工具方法

Collections集合的工具方法:

1)-public static boolean addAll(Collection c,T…elements);
2)-public static void shuffle(List list); //打乱集合中元素的顺序

3)public static void sort(List);
使用前提:
被排序的集合里面存储的元素必须实现:Comparable 接口,重写接口中的方法compareTo定义排序的规则

自己-参数:升序
参数-自己(this):降序

4)public static void sort(List , Comparator c);

Comparable :自己(this)和别人(参数)比较
Collections中集合的工具方法
使用方式:
8222860161)]
使用方式:
Collections中集合的工具方法