I have an abstract super class and a few derived class.
I want to create a method
createNew()
when invoked on a derived class it will create a new instance of the derived with a smart copy of all of its members.
All the members that are important for the creation are in the abstract class so the code should be the same.
can I write the implementation of createNew() in the super class?
something like that
SonA sonA2 = sonA1.createNew()
SonB sonB2 = sonB1.createNew()
the abs superclass should do the implementation because the code is identical .
thanks.