collection集合

List接口:Vector集合 --ArrayList集合---LinkedList集合

  有序的集合 

  允许重复的元素

  有索引,可以使用普通的for循环遍历

set接口:TreeSet集合---HashSet集合 (这两个是无序的集合 ,存取顺序不一致)      LinkedHashSet集合(有序的集合 )

  不允许重复的元素

  没有索引,不能使用for循环

Map

  hasmap

    无序的集合

  linkedhasmap

    有序的集合  

lambda表达式 

 前提 接口中只有一个抽象的方法

Collection<String> coll = new ArrayList<>();
Iterator<String> it = coll.iterator();
posted @ 2022-08-24 21:58  皇天不负有心人  阅读(14)  评论(0)    收藏  举报