1.看源码之前需要了解的一些内容 Node<K,V>[] table 哈希表结构中数组的名字 DEFAULT_INITIAL_CAPACITY: 数组默认长度16 DEFAULT_LOAD_FACTOR: 默认加载因子0.75 HashMap里面每一个对象包含以下内容: 1.1 链表中的键值对对象 包含: int hash; final K key; V value; Node<K,V> next; 1.2 红黑树中的键值对对象 包含: int hash; final K key; V value; TreeNode<K,V> parent; TreeNode<K,V> left; TreeNode<K,V> right; boolean red; 2.添加元素 HashMap<String,Integer> hm = new HashMap<>(); hm.put("aaa" , 111); hm.put("bbb" , 222); hm.put("ccc" , 333); hm.put("ddd" , 444); hm.put("eee" , 555);...