62,614
社区成员
发帖
与我相关
我的任务
分享
public Employee clone() throws CloneNotSupportedException{
Employee cloned=(Employee)super.clone();
cloned.hireday=(Date) hireday.clone();
return cloned;
}
为什么会有The return type is incompatible with Object.clone()的错误呢
public Object clone() throws CloneNotSupportedException{
Employee cloned=(Employee)super.clone();
cloned.hireday=(Date) hireday.clone();
return cloned;
}
@Override
protected Object clone() throws CloneNotSupportedException {
// TODO Auto-generated method stub
return super.clone();
}