forName() newInstance() Methods in Java

forName() newInstance() Methods: We have seen earlier, how to create an object without new keyword by cloning using the marker interface Cloneable. Now, Let is us see another style using forName() and newInstance() methods of class java.lang.Class. Example on using forName() newInstance() methods to create an object without new keyword public class Demo { int …

forName() newInstance() Methods in Java Read More »