13,100
社区成员
发帖
与我相关
我的任务
分享
/**
* Returns a clone of this vector. The copy will contain a
* reference to a clone of the internal data array, not a reference
* to the original internal data array of this <tt>Vector</tt> object.
*
* @return a clone of this vector.
*/
public synchronized Object clone() {
try {
Vector<E> v = (Vector<E>) super.clone();
v.elementData = new Object[elementCount];
System.arraycopy(elementData, 0, v.elementData, 0, elementCount);
v.modCount = 0;
return v;
} catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable
throw new InternalError();
}
}