Here you can find the source of newInstance(Class
public static <T> T newInstance(Class<T> classOf)
//package com.java2s; public class Main { public static <T> T newInstance(Class<T> classOf) { try {/*from w ww.ja va 2s. c om*/ return classOf.newInstance(); } catch (InstantiationException | IllegalAccessException ex) { return null; } } }