Here you can find the source of newInstance(Class klass)
public static Object newInstance(Class klass)
//package com.java2s; //License from project: Open Source License public class Main { public static Object newInstance(Class klass) { try {//from w w w . jav a 2 s . c om return klass.newInstance(); } catch (Exception e) { throw new RuntimeException(e); } } public static Object newInstance(String klassname) { return newInstance(classForName(klassname)); } public static Class classForName(String name) { try { return Class.forName(name); } catch (ClassNotFoundException ex) { throw new RuntimeException(ex); } } }