Re: How to store a class name in a variable and instantiate the object using that variable?
Posted By:
Jani_Kaarela
Posted On:
Wednesday, April 20, 2005 12:05 AM
Yes. Get the corresponding Class by using Class.forName(). Then instantiate it using Class.newInstance() or use reflection, if your class needs constructor params. See java.lang.Class and the whole java.lang.reflection package.