11月 3号

集合

1.Collection和数组的转换:  集合 ---> 数组 toArray()   数组 ---> 集合 Arrays.asList(new ...)  new int [] 看作是一个元素  new integet[] 多个元素

2.增强for循环:

Collection coll = new Arraylist();  int arr

for(Object obj : coll){  (int i : arr)  for(数组元素对象 局部变量 : 数组对象)

  sout(obj);

}

3.TreeSet中按照compare或compareTo比较,一旦相同就无法添加

4.Collection

posted @ 2020-11-03 23:03  accelerateInvolute  阅读(65)  评论(0)    收藏  举报