import java.lang.reflect.*; public class ConstructorModifiersExample { public static void main(String[] args) throws Exception { ConstructorIn this example, we use reflection to get the constructor of a class and then use the getModifiers() method to obtain its modifiers. We then use the Modifier.toString() method to convert the bit field to a string representation. The package library for the Constructor class is java.lang.reflect.constructor = SampleClass.class.getDeclaredConstructor(); int modifiers = constructor.getModifiers(); System.out.println(Modifier.toString(modifiers)); //prints "private" } } class SampleClass { private SampleClass() {} }