Java newInstance

With Java newInstacnce() of class Class, we can create an object as you will do with new keyword. Example on Java newInstance public class Student { int marks; public void display() { System.out.println(“Hello 1”); } public static void main(String args[]) throws InstantiationException, IllegalAccessException, ClassNotFoundException { Student std1 = new Student(); std1.marks = 50; Class cls1 …

Java newInstance Read More »