From 7dde745edd02968fa0acf227fbb2f4918c4f97e4 Mon Sep 17 00:00:00 2001 From: ruiruigirl <1147681296@qq.com> Date: Mon, 12 Aug 2019 19:08:39 +0800 Subject: [PATCH] feat: fix hash map desc --- notes/Java 容器.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/Java 容器.md b/notes/Java 容器.md index 5c037d73..1d3f6de4 100644 --- a/notes/Java 容器.md +++ b/notes/Java 容器.md @@ -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;