- Inheritance is the concept of adopting the features from the parent and reusing them .
- It involves passing the behavior of a class to another class.
- We can use an existing class to derive a new class.
- Derived classes inherit the data and methods of the super class.
- However, they can overwrite existing methods, and also add new ones.
No comments:
Post a Comment