public interface Cloneable
Object.clone(). The default behaviour of
clone()performs a shallow copy, but subclasses often change this to perform a deep copy. Therefore, it is a good idea to document how deep your clone will go. If
clone()is called on an object which does not implement this interface, a
CloneNotSupportedExceptionwill be thrown.
This interface is simply a tagging interface; it carries no
requirements on methods to implement. However, it is typical for
a Cloneable class to implement at least
increasing the accessibility of clone to be public. The typical
rather than a constructor, but this is not a requirement.
If an object that implement Cloneable should not be cloned,
simply override the
clone method to throw a
All array types implement Cloneable, and have a public
clone method that will never fail with a