Here you can find the source of newInstance(String className)
@SuppressWarnings("unchecked") public static <T> T newInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { @SuppressWarnings("unchecked") // we don't know what T is until runtime public static <T> T newInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { return newInstance(ClassLoader.getSystemClassLoader(), className); }/*from w ww . java 2 s . c om*/ @SuppressWarnings("unchecked") // we don't know what T is until runtime public static <T> T newInstance(ClassLoader classLoader, String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { if (className == null) { throw new ClassNotFoundException("Can not instantiate class. className must not be null"); } return (T) classLoader.loadClass(className).newInstance(); } }