Class getDeclaredConstructor() method in Java with Examples (original) (raw)

Last Updated : 16 Dec, 2019

The getDeclaredConstructor() method of java.lang.Class class is used to get the specified constructor of this class with the specified parameter type. The method returns the specified constructor of this class in the form of Constructor object. Syntax:

public Constructor getDeclaredConstructor(Class[] parameterType) throws NoSuchMethodException, SecurityException

Parameter: This constructor accepts a parameters parameterType which is the array of parameter type for the specified constructor.Return Value: This method returns the specified constructor of this class in the form of Constructor objects. Exception This method throws:

Similar Reads