2 Answers
Ans: Clone() is method in Java. object cloning is refer to creation of exact copy of an object. It creates a new instance of the class of current object and initializes all its fields with exactly the contents of the corresponding fields of this object. We can avoid cloning by giving already created object by clone method .
The object cloning is a way to create exact copy of an object. The clone() method of Object class is used to clone an object.
The java.lang.Cloneable interface must be implemented by the class whose object clone we want to create. If we don\’t implement Cloneable interface, clone() method generates CloneNotSupportedException. public
Object clone() throws CloneNotSupportedException