ClassFormatError in Java

Class ClassFormatError in Java

ClassFormatError is thrown from an application when java virtual machine attempts to read a binary format of the class file and determines that the file is malformed or can not be interpreted as a valid class file.

The structure of the ClassFormatError class is given as:

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

The class ClassFormatError also inherits methods from Object and Throwable class:

Ads code goes here
From Object classFrom Throwable class
clone()fillInStackTrace()
getClass()getMessage()
notify()printStackTrace()
wait()printStackTrace(PrintWriter)
wait(long, int)getLocalizedMessage()
wait(long)printStackTrace(PrintStream)
equals(Object)
toString()
finalize()
hashCode()
notifyAll()

Share and Enjoy !

READ  Abstract Interface ContentHandlerFactory in Java

Leave a Comment

Your email address will not be published. Required fields are marked *