In JAVA, say I have a string variable:
String x = "CoolClass";
And I have a class called CoolClass with a working constructor. How could I create an object of CoolClass, using the variable x, instead of typing CoolClass itself.
(I need to do this because x will be given by the user and read in by Scanner, and depending on their input, a different object/class will be constructed accordingly).