I was hoping to have a method that could return a object of class.
I have classes Class1, Class2 and Class3, which are derived from base class named as BaseClass, and then I have a class manager named as Manager with a method create(string). Is it possible to return an instance from Manager of classes Class1, Class2 or Class3 by invoking method create?
Example:
1 2
Manager m = Manager();
Class1 class1 = m.create("Class1");