What is inheritance explain 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  Google pixel 5 kaç lira?

Leave a Reply

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