Field getModifiers() method in Java with Examples
The getModifiers () method of java.lang.reflect.Field used to return the modifiers used for the field object as time of declaration, as an integer. The Modifier class should be used to decode the modifiers.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public int getModifiers()
Parameters: This method accepts accepts nothing.
Return: This method returns the Java language modifiers for the underlying member.
Below programs illustrate getModifiers () method: