getDeclaredConstructors
DeclaredConstructors is a Java Reflection API feature that allows programmatic access to the constructors of a class. It is part of the java.lang.reflect package and specifically found within the java.lang.Class class. When you obtain a Class object for a given class, you can then call its getDeclaredConstructors() method. This method returns an array of Constructor objects, each representing a constructor declared by that class.
The returned Constructor objects provide detailed information about each constructor, including its modifiers (like public, private,
It's important to distinguish getDeclaredConstructors() from getConstructors(). While getDeclaredConstructors() returns all constructors declared directly by the