Here you can find the source of getConstructor(Class> clazz, Object... args)
public static Constructor<?> getConstructor(Class<?> clazz, Object... args) throws SecurityException, NoSuchMethodException
//package com.java2s; //License from project: Apache License import java.lang.reflect.Constructor; public class Main { public static Constructor<?> getConstructor(Class<?> clazz, Object... args) throws SecurityException, NoSuchMethodException { Constructor<?> constructor = null; int length = args.length; Class<?>[] classes = new Class<?>[length]; for (int i = 0; i < length; i++) { Object object = args[i]; classes[i] = object.getClass(); }/*from w ww . jav a2s. c om*/ constructor = clazz.getConstructor(classes); return constructor; } }