ArrayList内部由数组构成,初始容量0
private static final int DEFAULT_CAPACITY = 10;
private static final Object[] EMPTY_ELEMENTDATA = {};
private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {};
transient Object[] elementData;
private int size;
扩容为1.5倍
int newCapacity = oldCapacity + (oldCapacity >> 1);
内部采用数组操作
elementData = Arrays.copyOf(elementData, newCapacity);
非线程安全