Cloneable

  • The Cloneable interface enables classes to support cloning, a process of creating a copy of an object.

  • Implementing this interface signals that the clone() method can be safely called on objects of that class.

  • If a class does not implement Cloneable and clone() is invoked, a CloneNotSupportedException is thrown.

public interface Cloneable
Known Indirect Subclasses

This (empty) interface must be implemented by all classes that wish to support cloning. The implementation of clone() in Object checks if the object being cloned implements this interface and throws CloneNotSupportedException if it does not.