What is class hierarchy example?

For example, we defined the Food class, and then several specializations, such as the Meat and Fruit classes . We have also seen that a class hierarchy represents “is-a” relationships. Each instance of a subclass is also an instance of the parent class and all ancestors.

Sizin İçin Seçtik  Which type of inheritance are used in Java?

Leave a Reply

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