Is there a way to create an instance of a particular class given the class name (dynamic) and pass parameters to its constructor.
Something like:
Obj
You can also invoke methods inside the created object.
You can create object instant by invoking the first constractor and then invoke the first method in the created object.
Class> c = Class.forName("mypackage.MyClass");
Constructor> ctor = c.getConstructors()[0];
Object object=ctor.newInstance(new Object[]{"ContstractorArgs"});
c.getDeclaredMethods()[0].invoke(object,Object... MethodArgs);