java入门 --集合工具类Collections

;/* * 集合的工具类(Collections) * 

注意:区别Collection是单列集合的根接口,Collection是操作集合的工具类 *  

* 类Collection * 

1. 对List进行二分查找 接收的是List集合 *

  int binarySearch(list, key); 

*  int binarySearch(list, key, Comparator); 

* 2. 对list集合进行排序 *  sort(list); *  sort(lsit, comparator); 

* 3. 对集合取最大值或是最小值 

*  max(Collection) *  max(Collection, comparator) 

*    min(Collection) *    min(Collection, comparator) *  

  *  4.对list集合进行反转 *  reverse(list); 

*  5. 可以将不同步的集合编程同步的集合; 

*  Set synchronizedSet(Sets) 

*  Map synchronizedMap(Mapm) 

*  List synchronizedList(Listlsit)

*

*/

public class Demo2 {

public static void main(String[] args){

}

}

你可能感兴趣的:(java入门 --集合工具类Collections)