1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Merge pull request #1469 from dengyongqiang/patch-1

Update arraylist-source-code.md
This commit is contained in:
Guide哥 2021-12-03 20:05:53 +08:00 committed by GitHub
commit ce1db791d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,7 +150,8 @@ public class ArrayList<E> extends AbstractList<E>
ensureExplicitCapacity(minCapacity);
}
}
//得到最小扩容量
//1.得到最小扩容量
//2.通过最小容量扩容
private void ensureCapacityInternal(int minCapacity) {
if (elementData == DEFAULTCAPACITY_EMPTY_ELEMENTDATA) {
// 获取“默认的容量”和“传入参数”两者之间的最大值