package com.logicbig.example.field;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
public class GetModifiersExample2 {
protected transient volatile int i;
public static void main(String... args) throws NoSuchFieldException {
Field f = GetModifiersExample2.class.getDeclaredField("i");
int modifiers = f.getModifiers();
System.out.println(modifiers);
String s = Modifier.toString(modifiers);
System.out.println(s);
boolean b = Modifier.isProtected(modifiers);
System.out.println(b);
}
}
Output
196
protected transient volatile
true