All About InstantiationError in Java



InstantiationError is thrown from an application when an application tries to use the java new operator to instanciate an abstract class or an interface. Normally this error is caught by the compiler. This error can only occur at runtime if the definition of the class has incompatibly changed.
The structure of the class InstantiationError is given below:


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

}
 
All About InstantiationError in Java All About InstantiationError in Java Reviewed by Animesh Chatterjee on September 19, 2018 Rating: 5

No comments:

Powered by Blogger.