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


Advertisements

Description

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

Declaration

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

public static int classModifiers()

Returns

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

Example

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

package com.tutorialspoint;

import java.lang.reflect.Modifier;

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

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

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

public protected private abstract static final strictfp
java_reflect_modifier.htm
Advertisements