What is hierarchical inheritance in Java with example?

When two or more classes inherits a single class , it is known as hierarchical inheritance. In the example given below, Dog and Cat classes inherits the Animal class, so there is hierarchical inheritance.

Sizin İçin Seçtik  How do you take input in darts?

Leave a Reply

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