ClassFormatError

  • ClassFormatError is thrown when the Java Virtual Machine (JVM) fails to read or interpret a class file due to its malformed structure.

  • This error is a subclass of LinkageError and has two direct subclasses: GenericSignatureFormatError and UnsupportedClassVersionError.

  • It provides two constructors: one with no detail message and another accepting a custom error message.

  • ClassFormatError inherits methods from Throwable for exception handling, such as retrieving stack trace and error messages.

public class ClassFormatError extends LinkageError
Known Direct Subclasses

Thrown when the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file.

Public Constructor Summary

ClassFormatError()
Constructs a ClassFormatError with no detail message.
ClassFormatError(String s)
Constructs a ClassFormatError with the specified detail message.

Inherited Method Summary

Public Constructors

public ClassFormatError ()

Constructs a ClassFormatError with no detail message.

public ClassFormatError (String s)

Constructs a ClassFormatError with the specified detail message.

Parameters
s the detail message.