public ArrayList(Collection<? extends E> c) {elementData = c.toArray();size = elementData.length;// c.toArray might (incorrectly) not return Object[] (see 6260652)if (elementData.getClass() != Object[].class) elementData = Arrays.copyOf(elementData, size, Object[].class);}c.toArray might not return Object[] 不明白toArray为何会不返回object[],有没有其他例子说明下呢? stackoverflow有这个问题,不过回答貌似也没有启发的感觉,是我智商捉急了么- -||http://stackoverflow.com/questions/8521147/why-need-to-convert-type-to-object-array-in-arraylists-construction
添加回答
举报
0/150
提交
取消
