❔ ✅ Inheritance/sharing variables
In the pseudocode provided, is there a better way to do what I'm trying to do. Basically when one of the children is constructed in
Class1
, passing in itself, is there a way to, for example, make a constructor in the BaseClass
that takes an object, and if that object shares any variable names, set BaseClass
's variables of those shared names to the values of those in the parameter's?2 Replies