You can use Class.forName()
to get a Class
object of the desired class.
Then use getConstructor()
to find the desired Constructor
object.
Finally, call newInstance()
on that object to get your new instance.
Class<?> c = Class.forName("mypackage.MyClass");
Constructor<?> cons = c.getConstructor(String.class);
Object object = cons.newInstance("MyAttributeValue");