Here you can find the source of invokeCtor(Constructor ctor, String str)
private static Object invokeCtor(Constructor ctor, String str)
//package com.java2s; //License from project: LGPL import java.lang.reflect.Constructor; public class Main { private static Object invokeCtor(Constructor ctor, String str) { try {//ww w. j a va2 s . c o m return ctor.newInstance(new Object[] { str }); } catch (Throwable t) { //System.err.println("Error in constructor invocation with argument "+str+" : "+t.getMessage()); return null; } } }