Here you can find the source of getConstructor(Class> clazz, Class>... args)
public static MethodHandle getConstructor(Class<?> clazz, Class<?>... args)
//package com.java2s; //License from project: Open Source License import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.reflect.Constructor; import java.util.Arrays; public class Main { /**//from w w w .java 2 s . c o m * Gets a constructor that has the specified types of arguments. * Throw an IllegalStateException if the class does not have such a constructor. */ public static MethodHandle getConstructor(Class<?> clazz, Class<?>... args) { try { // We use unreflect so that we can make the constructor accessible Constructor<?> ctor = clazz.getDeclaredConstructor(args); ctor.setAccessible(true); return MethodHandles.lookup().unreflectConstructor(ctor); } catch (NoSuchMethodException e) { throw new IllegalStateException( clazz.getName() + " has no constructor with args " + Arrays.toString(args), e); } catch (IllegalAccessException e) { throw new IllegalStateException( "Problem getting constructor for " + clazz.getName() + " with args " + Arrays.toString(args), e); } } }