219k views
3 votes
In object oriented programming new classes can be defined by extending existing classes. This is an example of:

(a) Encapsulation
(b) Interface
(c) Composition
(d) Inheritance
(e) Aggregation.

User Naou
by
7.6k points

1 Answer

2 votes

Final answer:

Inheritance is the OOP concept where a new class is defined by extending an existing class, absorbing its properties and behaviors, and potentially adding new ones.

Step-by-step explanation:

When new classes in object-oriented programming are defined by extending existing classes, this process is known as inheritance. Inheritance allows a new class, called a subclass or derived class, to absorb the properties and behaviors of the parent or base class, while also introducing its own unique attributes and methods. This key characteristic of OOP promotes code reusability and can lead to a more organized and modular code structure. When subclassing, the derived class inherits attributes and methods from its parent, and it can also override or extend these, providing more specific implementation for some of them.

User Mike Dg
by
8.5k points