useClone
在下面的示例中,由和创建的对象之间有什么区别copyConstrutor
吗?
class A implements Cloneable{
int data = 9;
public A useClone() throws CloneNotSupportedException {
return (A)super.clone();
}
public A copyConstrutor() {
A o = new A();
o.data = this.data;
return o;
}
}