java class newinstance

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…