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



Description

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

Declaration

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

public static int constructorModifiers()

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.constructorModifiers() method.

Live Demo
package com.tutorialspoint;

import java.lang.reflect.Modifier;

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

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

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

public protected private
java_reflect_modifier.htm
Advertisements