java.lang.reflect.InaccessibleObjectException
时间: 2023-09-21 15:13:07 浏览: 49
java.lang.reflect.InaccessibleObjectException is a checked exception that is thrown when an attempt is made to access a member of a class, field, method or constructor that is inaccessible due to its access modifier. This exception is typically thrown by the Java reflection API when an attempt is made to access a method or field of a class that is not accessible from the current context.
InaccessibleObjectException was introduced in Java 9 as part of the Java Platform Module System (JPMS). The JPMS added a new layer of access control to Java, which restricts access to certain classes and members based on their module boundaries.
The InaccessibleObjectException extends the ReflectiveOperationException class and indicates that the requested operation is not accessible. It can be caught and handled like any other checked exception.