Thursday, October 23, 2025
HomeLanguagesJavaModifiers interfaceModifiers() method in Java with Examples

Modifiers interfaceModifiers() method in Java with Examples

The interfaceModifiers() method of java.lang.reflect.Modifier class is used to get an integer value together with the modifiers of source language that can be applied to an interface.

Syntax:

public static boolean interfaceModifiers()

Parameters: This method accepts nothing.

Return: This method returns an int value OR-ing together the source language modifiers that can be applied to an interface.

Below programs illustrate interfaceModifiers() method:
Program 1:




// Java program to illustrate
// interfaceModifiers() method
import java.lang.reflect.*;
  
public class GFG {
  
    public static void main(String[] args)
        throws NoSuchFieldException,
               SecurityException
    {
  
        // get Modifier using interfaceModifiers()
        int result = Modifier.interfaceModifiers();
  
        System.out.println("Interface Modifiers: "
                           + Modifier.toString(result));
    }
}


Output:

Interface Modifiers: public protected private abstract static strictfp

Program 2:




// Java program to illustrate
// interfaceModifiers()
  
import java.lang.reflect.*;
  
public class GFG {
  
    public static void main(String[] args)
        throws NoSuchFieldException,
               SecurityException
    {
  
        // get Modifier
        // using interfaceModifiers()
        int result
            = Modifier.interfaceModifiers();
  
        System.out.println("Int Value: "
                           + result);
    }
}


Output:

Int Value: 3087

References: https://docs.oracle.com/javase/10/docs/api/java/lang/reflect/Modifier.html#interfaceModifiers()

RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS