© Vaskaran Sarcar 2020Vaskaran SarcarInteractive Object-Oriented Programming in Javahttps://doi.org/10.1007/978-1-4842-5404-2_4
4. The Concept of Inheritance
Bangalore, Karnataka, India
The main objective of inheritance is to promote reusability and eliminate redundancy in code. It also demonstrates how a child class can obtain the features (or characteristics) of its parent class. Since a parent class is placed at a higher level in the class hierarchy, and a child class can derive from it. A child class is often referred to as a derived class or subclass. A parent class is also referred to as a super class.
In general, you will deal with four types of inheritance. In Java, a class can inherit from another ...