All About INTERFACE Cloneable in Java



A class that implements the Cloneable interface,indicates to the clone() method in the class Object that it is legal for that method to make a field for field copy of instances of that class. Any attempt to clone instances that do not implement the cloneable interface results in the exception- CloneNotSupportedException being thrown.
The structure is given below:

public interface java.lang.Cloneable{
}
 
All About INTERFACE Cloneable in Java All About INTERFACE Cloneable  in Java Reviewed by Animesh Chatterjee on September 17, 2018 Rating: 5

No comments:

Powered by Blogger.