We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad6183e commit 844801eCopy full SHA for 844801e
MD/HashMap.md
@@ -32,4 +32,7 @@ get 和 put 类似,也是将传入的 Key 计算出 index ,如果该位置
32
33
> 所以 HashMap 只能在单线程中使用,并且尽量的预设容量,尽可能的减少扩容。
34
35
+在 `JDK1.8` 中对 `HashMap` 进行了优化:
36
+当 hash 碰撞之后写入链表的长度超过了阈值(默认为8),链表将会转换为红黑树。
37
+
38
多线程场景下推荐使用 [ConcurrentHashMap](https://github.com/crossoverJie/Java-Interview/blob/master/MD/ConcurrentHashMap.md)。
0 commit comments