未验证 提交 7ae8fc39 编写于 作者: C CyC2018 提交者: GitHub

Merge pull request #769 from ruiHut/hashmap

#768 issue Java 容器 JDK.1.7 HashMap 扩容源代码描述
......@@ -650,7 +650,7 @@ static int indexFor(int h, int length) {
| capacity | table 的容量大小,默认为 16。需要注意的是 capacity 必须保证为 2 的 n 次方。|
| size | 键值对数量。 |
| threshold | size 的临界值,当 size 大于等于 threshold 就必须进行扩容操作。 |
| loadFactor | 装载因子,table 能够使用的比例,threshold = capacity * loadFactor。|
| loadFactor | 装载因子,table 能够使用的比例,threshold = (int)(newCapacity * loadFactor)。|
```java
static final int DEFAULT_INITIAL_CAPACITY = 16;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册