What is a hierarchical inheritance give an example?

In hierarchical inheritance, all features that are common in child classes are included in the base class. For example, Physics, Chemistry, Biology are derived from Science class. Similarly, Dog, Cat, Horse are derived from Animal class .

Sizin İçin Seçtik  What are the different types of inheritance?

Leave a Reply

Your email address will not be published. Required fields are marked *