Inheritance and the IS-A Relationship
Inheritance is an OOPS mechanism where a derived or child class acquires accessible members and behavior from a base or parent class and can extend or specialize that behavior. An IS-A relationship means the derived type is a valid conceptual specialization of the base type. For example, a SavingsAccount IS-A BankAccount. At a senior engineering level, I use inheritance only when the subtype genuinely satisfies the behavioral contract of the base type, otherwise composition is usually safer.
Inheritance represents an IS-A relationship.
The child specializes or extends the behavior of the parent.
It enables polymorphism through a common base type.
Inheritance creates coupling between parent and child.
The Liskov Substitution Principle should be considered before introducing inheritance.