Java tutorial
//package com.java2s; //License from project: Apache License import java.lang.reflect.Constructor; public class Main { public static Object newInstance(Class cls, Class<?>[] types, Object... params) { Constructor<?> mConstructor; try { return cls.getClass().newInstance(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } }