Java tutorial
class MyClass { public MyClass() { System.out.println("called"); } } public class Main { public static void main(String[] args) throws InstantiationException { Class<MyClass> personClass = MyClass.class; try { MyClass p = personClass.newInstance(); System.out.println(p); } catch (InstantiationException | IllegalAccessException e) { System.out.println(e.getMessage()); } } }