假设ArrayList之前是空的.然后我将一个对象添加到索引为1,000,000的ArrayList.
ArrayList会创建1,000,001个指针还是只创建一个指针?
将抛出IndexOutOfBoundsException:
IndexOutOfBoundsException - 如果索引超出范围(索引<0 || index> size())
http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#add(int,E)