Příklad
public class
ClassA
implements
Cloneable
{
public
Object clone
throws
CloneNotSupportedException () {
//...
}
}
Řešení
Vždy deklarujte metodu clone jako
final
.
public class
ClassA
implements
Cloneable
{
public final
Object clone
throws
CloneNotSupportedException () {
//...
}
}