Here you can find the source of getConstructor(Class> theClass, Class>[] paramTypes)
public static Constructor<?> getConstructor(Class<?> theClass, Class<?>[] paramTypes)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Constructor; public class Main { public static Constructor<?> getConstructor(Class<?> theClass, Class<?>[] paramTypes) { Constructor<?> constructor = null; try {/* w w w. j a va 2 s .com*/ constructor = theClass.getDeclaredConstructor(paramTypes); constructor.setAccessible(true); } catch (NoSuchMethodException | SecurityException e) { } if (constructor == null) { Class<?> superClasss = theClass.getSuperclass(); if (superClasss != null) constructor = getConstructor(superClasss, paramTypes); } return constructor; } }