Here you can find the source of newInstance(String aclass)
public static Object newInstance(String aclass) throws RuntimeException
//package com.java2s; public class Main { public static Object newInstance(String aclass) throws RuntimeException { try {/*from w ww . j a v a 2s . co m*/ Class<?> lClass = Class.forName(aclass); Object instance = lClass.newInstance(); return instance; } catch (ClassNotFoundException cnfe) { throw new RuntimeException(); } catch (InstantiationException insExp) { throw new RuntimeException(); } catch (IllegalAccessException iExp) { throw new RuntimeException(); } } }