範例
public class
ClassA
implements
Cloneable
{{
public final
void clone
throws
CloneNotSupportedException () {
//...
}
解決方案
遵循 clone 方法的適當簽章
。
public class
ClassA
implements
Cloneable
{{
public final
Object clone
throws
CloneNotSupportedException () {
//...
}
}