M
Michael Preminger
Hello!
I have an application where I use different types of persons.
Sometimes I need to convert a general Person (superclass) into a
specific one(subclass)
Is there a way to do it per constructor of the subclass, like:
public Subperson (Person person)
without explicitly copying the member values from the super object
and destroying it later?
Or do I need to do it outside the class, like
Subperson sp = (Subperson) person ?
I would prefer the former, if it was possible.
Thanks
Michael
I have an application where I use different types of persons.
Sometimes I need to convert a general Person (superclass) into a
specific one(subclass)
Is there a way to do it per constructor of the subclass, like:
public Subperson (Person person)
without explicitly copying the member values from the super object
and destroying it later?
Or do I need to do it outside the class, like
Subperson sp = (Subperson) person ?
I would prefer the former, if it was possible.
Thanks
Michael