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

Update ArrayList.md

This commit is contained in:
SnailClimb 2018-12-28 10:45:36 +08:00 committed by GitHub
parent aff1f0ae01
commit 98ae0e7b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,7 @@ public class ArrayList<E> extends AbstractList<E>
} }
/** /**
*默认构造函数,其默认初始容量为10 *默认构造函数,DEFAULTCAPACITY_EMPTY_ELEMENTDATA 为0.初始化为10也就是说初始其实是空数组 当添加第一个元素的时候数组容量才变成10
*/ */
public ArrayList() { public ArrayList() {
this.elementData = DEFAULTCAPACITY_EMPTY_ELEMENTDATA; this.elementData = DEFAULTCAPACITY_EMPTY_ELEMENTDATA;