If child classes can inherit properties and methods from a parent class, does it work the other way around? Can a parent class inherit properties and methods from a child class?


#1

Question

If child classes can inherit properties and methods from a parent class, does it work the other way around? Can a parent class inherit properties and methods from a child class?

Answer

No, the purpose of having a parent class is to make a blueprint of the methods and properties that are shared with child classes. You would add properties and methods to a child class because they are unique to that child. A parent class wouldn’t and shouldn’t need to have the same kind of inheritance relationship.