Why the concept of inheritance was introduced in OOP?

1 answer

Answer

1281522

2026-08-09 01:36

+ Follow

In object-oriented programming, inheritance allows the creation of is-a relationships. For example, a car is a vehicle, and a bike is a vehicle, so those could be modeled through a vehicle class, and a pair of car and bike classes, both derived from (inheriting from) the vehicle class. Derived classes like car and bike share common vehicle properties, such as speed, location, direction, number of wheels, etc.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.