码迷,mamicode.com
首页 > 编程语言 > 详细

JAVA 集合随笔

时间:2019-04-06 18:58:38      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:lis   blog   ref   lin   split   href   操作   tor   require   

JDK1.8;(仅列举常见的)

一:

Iterable接口:三个方法;

        Iterator<T> iterator();

  default void forEach(Consumer<? super T> action) {  
    Objects.requireNonNull(action);
    for (T t : this) {
      action.accept(t);
    }
  }

  default Spliterator<T> spliterator() {
              return Spliterators.spliteratorUnknownSize(iterator(), 0);
  }

Collection接口:主要的三个子接口 List Set Queue。同时继承了Iterable接口。

Map接口:主要的抽象类 AbstractMapAbstractMap 主要的实现类:HashMapTreeMap; 接口ConcurrentMap 继承了AbstractMap ;LinkedHashMap继承了HashMap;ConcurrentHashMap继承了AbstractMap,实现了ConcurrentMap 。

Collections:实现一些集合操作的类。

二:

List:主要实现ArrayList(数组实现)LinkedList(链表实现)Vector(线程安全:synchronized关键字实现)Stack(继承Vector)

Set:主要实现HashSet(无序不可重复)TreeSet(红黑树实现)LinkedHashSet

Queuehttps://www.cnblogs.com/lemon-flm/p/7877898.html ;

三:

MapConcurrentHashMap(分段锁);TreeMap(红黑树);HashMap

 

JAVA 集合随笔

标签:lis   blog   ref   lin   split   href   操作   tor   require   

原文地址:https://www.cnblogs.com/dev1ce/p/10662297.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!