Here you can find the source of newInstance(Class cmdClass)
public static Object newInstance(Class cmdClass)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Constructor; public class Main { public static Object newInstance(Class cmdClass) { return newInstance(cmdClass, null, null); }//from ww w .j a v a 2 s . c o m public static Object newInstance(Class cmdClass, Class[] parameterTypes, Object[] parameters) { try { Constructor con = cmdClass.getConstructor(parameterTypes); Object instance = con.newInstance(parameters); return instance; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } }