未验证 提交 5061b89a 编写于 作者: S someone 提交者: GitHub

错别字修正:装载印子 -> 装载因子

上级 3a35b24e
......@@ -15,9 +15,9 @@ HashMap类中有以下主要成员变量:
* transient int size;
* 记录了Map中KV对的个数
* loadFactor
* 装载子,用来衡量HashMap满的程度。loadFactor的默认值为0.75f(`static final float DEFAULT_LOAD_FACTOR = 0.75f;`)。
* 装载子,用来衡量HashMap满的程度。loadFactor的默认值为0.75f(`static final float DEFAULT_LOAD_FACTOR = 0.75f;`)。
* int threshold;
* 临界值,当实际KV个数超过threshold时,HashMap会将容量扩容,threshold=容量*载因子
* 临界值,当实际KV个数超过threshold时,HashMap会将容量扩容,threshold=容量*载因子
* 除了以上这些重要成员变量外,HashMap中还有一个和他们紧密相关的概念:capacity
* 容量,如果不指定,默认容量是16(`static final int DEFAULT_INITIAL_CAPACITY = 1 << 4;`)
......@@ -166,4 +166,4 @@ HashMap中size表示当前共有多少个KV对,capacity表示当前HashMap的
PS:文中分析基于JDK1.8.0_73
[1]: http://www.hollischuang.com/wp-content/uploads/2018/05/paramInMap.png
[2]: http://www.hollischuang.com/archives/2091
\ No newline at end of file
[2]: http://www.hollischuang.com/archives/2091
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册