How do I make instances of different child classes have the same instance of their common parent class?
Solution 1:
I don't think that inheritence is the right solution to your problem. Is it necessary that Student
and Staff
are different classes?
It seems that it would be more appropriate that a student or a staff member are just instances of Person
, and there is a member property role
which may contain "Student"
or "Staff"
or both.