What is inheritance in Java with real life example?

Inheritance is the capability of one class to inherit capabilities or properties from another class in Java . For instance, we are humans. We inherit certain properties from the class ‘Human’ such as the ability to speak, breathe, eat, drink, etc. We can also take the example of cars.

Sizin İçin Seçtik  What is the concept of inheritance?

Leave a Reply

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