Here you can find the source of newInstance(Class clazzName)
public static final Object newInstance(Class clazzName) throws ClassNotFoundException, IllegalAccessException, InstantiationException
//package com.java2s; //License from project: Open Source License import java.lang.reflect.InvocationTargetException; public class Main { public static final Object newInstance(String clazzName) throws ClassNotFoundException, IllegalAccessException, InstantiationException { return Class.forName(clazzName).newInstance(); }/* w w w. ja va2 s. c om*/ public static final Object newInstance(Class clazzName) throws ClassNotFoundException, IllegalAccessException, InstantiationException { return clazzName.newInstance(); } public static final Object newInstance(String clazzName, Class[] paramsType, Object[] constrArgs) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException, SecurityException, NoSuchMethodException, ClassNotFoundException { return newInstance(Class.forName(clazzName), paramsType, constrArgs); } public static final Object newInstance(Class clazzName, Class[] paramTypes, Object[] constrArgs) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException, SecurityException, NoSuchMethodException { return clazzName.getConstructor(paramTypes).newInstance(constrArgs); } }