How can I add a bunch of classes to an ArrayList<MyBaseClass>
and then later retrieve a Class (derived from, but not MyBaseClass
) from the ArrayList
and use it to generate a new object of the actual Class retrieved (i.e. not MyBaseClass
since that is abstract)
All classes that need to be added all derive from the same abstract base Class (MyBaseClass
)
I can't really think of another way to achieve what I want to do, so hopefully this is possible... ?