Java基础之LinkedHashMap源码解析
Java集合源码解析系列 Java基础之HashMap源码解析 Java基础之ArrayList源码解析 LinkedHashMap public class LinkedHashMap<K,V> extends HashMap<K,V> implements Map<K,V> { /** * HashMap.Node的子类 * 增加了前后节点的引用,因此不再是单链表而是双向链表 */ static class Entry<K,V> extends HashMap.Node<K,V> { Entry<K,V> before, after; Entry(int hash, K key, V value, Node<K,V> next) { super(hash, key, value, next); } } /** * 双向链表的头节点和尾节点 * */ transient LinkedHashMap.Entry<K,V> head; transient LinkedHashMap.Entry...