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



Description

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

Declaration

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

public static int methodModifiers()

Returns

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

Example

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

package com.tutorialspoint;

import java.lang.reflect.Modifier;

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

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

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

public protected private abstract static final synchronized native strictfp
java_reflect_modifier.htm
Advertisements