java.lang.reflect.Modifier.fieldModifiers() Method Example



Description

The java.lang.reflect.Modifier.fieldModifiers() method return an int value OR-ing together the source language modifiers that can be applied to a field.

Declaration

Following is the declaration for java.lang.reflect.Modifier.fieldModifiers() method.

public static int fieldModifiers()

Returns

an int value OR-ing together the source language modifiers that can be applied to a field.

Example

The following example shows the usage of java.lang.reflect.Modifier.fieldModifiers() method.

package com.tutorialspoint;

import java.lang.reflect.Modifier;

public class ModifierDemo {
   public static void main(String[] args) {

      System.out.println(Modifier.toString(Modifier.fieldModifiers()));
   }
}

Let us compile and run the above program, this will produce the following result −

public protected private static final transient volatile
java_reflect_modifier.htm
Advertisements