The getTypeParameters() method of a Constructor class is used to get an array of TypeVariable objects declared by this Constructor Object, in declaration order. Elements of array represent the type variables objects declared by Method. An array of length 0 is returned by this getTypeParameters(), if the Method Object generic declaration contains no type variables.
public TypeVariable<Constructor<T>> getTypeParameters()
Parameters: This method does not accept any parameters.
Return value: This method returns an array of TypeVariable objects that represent the type variables declared by this generic declaration.
Exception: This method throws GenericSignatureFormatError if the generic signature of this generic declaration does not conform to the format specified in The Java™ Virtual Machine Specification.
Below programs illustrate the getTypeParameters() method:
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. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.