大家都知道 ArrayList是自动扩容的. 那为什么会存在越界问题? 话不多说 上代码 package test; import java.util.ArrayList; public class ThreadUnSafe { public static ArrayList<Integer> numberList= new ArrayList<Integer>(); public static class addToList implements Runnable{ int st
ArrayList关键属性分析 ArrayList采用Object数组来存储数据 /** * The array buffer into which the elements of the ArrayList are stored. * The capacity of the ArrayList is the length of this array buffer. 何问起 hovertree.com */ transient Object[] elementData; // non-priva