1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-20 22:17:09 +08:00

Update ArrayList-Grow.md

This commit is contained in:
SnailClimb 2020-07-25 09:07:52 +08:00 committed by GitHub
parent 25e66b2f80
commit f3182f98d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,6 +74,9 @@
return true;
}
```
> **注意** JDK11 移除了 `ensureCapacityInternal()``ensureExplicitCapacity()` 方法
### 2. 再来看看 `ensureCapacityInternal()` 方法
可以看到 `add` 方法 首先调用了`ensureCapacityInternal(size + 1)`