Inheritance

Inheritance

Inheritance allows a class to absorb or inherit all the properties and methods of another class. It is like a parent-child relationship where the child inherits some properties from his/her parents…