@Deprecated(since="9")
public boolean isAccessible()
Returns the value of the accessible flag for this reflected object
Deprecated.
This method is deprecated because its name hints that it checks if the reflected object is accessible when it actually indicates if the checks for Java language access control are suppressed. This method may return false on a reflected object that is accessible to the caller. To test if this reflected object is accessible, it should use canAccess(Object).
Examples
package com.logicbig.example.field;
import java.lang.reflect.Field;
public class IsAccessibleExample {
private static class Test { private String str; }
public static void main(String... args) throws NoSuchFieldException { Field f = Test.class.getDeclaredField("str"); System.out.println(f.isAccessible()); } }