Here you can find the source of newInstance(Class clazz)
static public Object newInstance(Class clazz) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; public class Main { static public Object newInstance(Class clazz) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { try {/*from w w w . j ava2 s .c om*/ return clazz.newInstance(); } catch (Exception ex) { @SuppressWarnings({ "rawtypes", "unchecked" }) Constructor constructor = clazz.getDeclaredConstructor(null); constructor.setAccessible(true); return constructor.newInstance(new Object[0]); } } }