Here you can find the source of getConstructor(Class> clazz, Class>... parameterTypes)
Parameter | Description |
---|---|
clazz | a parameter |
parameterTypes | a parameter |
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Constructor; public class Main { /**//from w ww. j a va2 s . co m * Fail-safe. * @param clazz * @param parameterTypes * @return null on errors. */ public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes) { try { return clazz.getConstructor(parameterTypes); } catch (NoSuchMethodException e) { } catch (SecurityException e) { } return null; } }