The constructor class provides information about a single constructor for a class and it also provides access to that constructor.
The getName() method of java.lang.reflect.Constructor is used to return this constructor name, as a string. Constructor name is the binary name of the constructor’s declaring class.
public String getName()
Parameters: This method accepts nothing.
Return: This method returns the simple name of the underlying member in String format.
Below programs illustrate getName() method:
Constructor : java.lang.String
Constructor Name : java.util.ArrayList
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.