Here you can find the source of getConstructorsOfLength(final Class clazz, final int length)
public static List<Constructor> getConstructorsOfLength(final Class clazz, final int length)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; public class Main { public static List<Constructor> getConstructorsOfLength(final Class clazz, final int length) { List<Constructor> fixedLengthConstructors = new ArrayList<Constructor>(1); Constructor[] constructors = clazz.getDeclaredConstructors(); for (int i = 0; i < constructors.length; i++) { if (!Modifier.isPublic(constructors[i].getModifiers())) continue; Class[] parameterTypes = constructors[i].getParameterTypes(); if (parameterTypes.length == length) fixedLengthConstructors.add(constructors[i]); }/*w w w.j av a 2s . c om*/ return fixedLengthConstructors; } }