Here you can find the source of newInstance(String className)
public static Object newInstance(String className)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w ww. j ava 2 s . c om*/ * Return a new instance of the class using the default constructor. */ public static Object newInstance(String className) { try { Class<?> cls = Class.forName(className); return cls.newInstance(); } catch (Exception e) { String msg = "Error constructing " + className; throw new IllegalArgumentException(msg, e); } } }