creating java object without new keyword

Creating Java Object without new Keyword using Reflection

Object without new Keyword: We have seen four styles of creating a Java object without using new keyword. Now let us see with Reflection API Constructor class. Example on Object without new Keyword:

Class cl = Class.forName(“Demo”); Constructor con[] = cl.getDeclaredConstructors(); forName() method of class Class loads the class…