IllegalAccessError

  • IllegalAccessError is thrown when an application tries to access or modify a field or call a method it doesn't have access to.

  • This error usually gets caught during compilation, but it can happen at runtime if a class definition changes incompatibly.

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

  • IllegalAccessError inherits methods from Throwable and Object for exception handling and object management.

public class IllegalAccessError extends IncompatibleClassChangeError

Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

Public Constructor Summary

IllegalAccessError()
Constructs an IllegalAccessError with no detail message.
IllegalAccessError(String s)
Constructs an IllegalAccessError with the specified detail message.

Inherited Method Summary

Public Constructors

public IllegalAccessError ()

Constructs an IllegalAccessError with no detail message.

public IllegalAccessError (String s)

Constructs an IllegalAccessError with the specified detail message.

Parameters
s the detail message.