1】子类继承时可以改变方法范围,可以去掉异常
@Override
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
// TODO Auto-generated catch block
throw new RuntimeException(e);
}
}
父类是protected ,并且抛出异常
protected native Object clone() throws CloneNotSupportedException;
@Override
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
// TODO Auto-generated catch block
throw new RuntimeException(e);
}
}
父类是protected ,并且抛出异常
protected native Object clone() throws CloneNotSupportedException;