Use Inheritance So You Dont Repeat Yourself. How inheritance is declared?

Thank you once again for your time and effort! After reading and watching additional materials, I realized that this topic is much broader than I expected. But thanks to your explanation I finally have some understanding of what’s going on here. At least theoretically. My last question is how do we create a simple three stage collection of objects inheriting properties from one another? I still have troubles with practical implementation.

For example

Superclass
Creature
Properties
main task: survive and reproduce

Subclass1
Mammal
Properties
main task: survive and reproduce
+
blood: warm

Subclass2
Dog
Properties
main task: survive and reproduce
+
blood: warm
+
secondary task: help human

1 Like