|
Assuming the name of the class that you want to create an instance of is in a properties object called props under the key "abc" and that the class named supports an interface called MyInterface. Code below will work as long as the class specified has an empty constructor.
String className = props.getProperty("abc");
Class c = Class.forName(className);
MyInterface myInstance = (MyInterface) c.newInstance();
|