源码:  

public ArrayList(Collection<? extends E> c) {
        elementData = c.toArray();
        if ((size = elementData.length) != 0) {
            // c.toArray might (incorrectly) not return Object[] (see 6260652)
            if (elementData.getClass() != Object[].class)
                elementData = Arrays.copyOf(elementData, size, Object[].class);
        } else {
            // replace with empty array.
            this.elementData = EMPTY_ELEMENTDATA;
        }
    }

toArray返回的Object[]数组啊,为什么还要copy一次呢?

look下面:

//这样会报java.lang.ArrayStoreException,因为看起来是Object[]实际为String[],所以其他类型放不进去

Object[] arr1 = new String[2];

arr1[0] = 1;

//如果构造函数不做这个处理if (elementData.getClass() != Object[].class)
//                elementData = Arrays.copyOf(elementData, size, Object[].class);

//有可能也会报上面那个错误

List<String> list = new ArrayList<String>();

list.add("test1");

list.add("test2");

Object[] arr = list.toArray();

arr[0] = 1;