All About Class CloneNotSupportedException in Java



CloneNotSupportedException is thrown from the code to indicate that the clone() method in the class Object has been called to clone an object but the Object's class does not implement the cloanable interface.Applications that override the clone() method can also throw this exception to indicate that the object could not be or should not be cloned.
The structure of the class as follows:


public class java.lang.CloneNotSupportedException extends java.lang.Exception{
//constructor
public CloneNotSupportedException();
//constructs an empty CloneNotSupportedException object that is an object with no message specified.
public CloneNotSupportedException(String message);
//constructs an CloneNotSupportedException object with the message specified.

}
 
All About Class CloneNotSupportedException in Java All About Class CloneNotSupportedException in Java Reviewed by Animesh Chatterjee on September 17, 2018 Rating: 5

No comments:

Powered by Blogger.