Class IncompatibleClassChangeError in Java

Class IncompatibleClassChangeError in Java

IncompatibleClassChangeError is thrown from an application to indicate that an incompatible class change has occurred to some class definition. The definition of some class on which the currently executing method depends has changed.

This is the superclass of a group of related error types. It signals some kind of illegal use of a legal class.

An IncompatibleClassChangeError or one of its subclasses is thrown when a class refers to another class in an incompatible way. This situation occurs when the current definition of the referenced class is incompatible with the definition of the class that was found when the referring class was compiled.

For example,
say class A refers to a method in class B. Then, after class A is compiled, the method is removed from class B. When class A is loaded, the run-time system discovers that the method in class B no longer exists and throws an error.

The structure of the IncompatibleClassChangeError class is given below:

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

The class IncompatibleClassChangeError also inherits methods from class Object and Throwable.

From Object classFrom Throwable class
wait(long, int)getLocalizedMessage()

Share and Enjoy !

Leave a Reply

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