What is inheritance in OOP?

Object Oriented Programming Questions



47 Short 36 Medium 25 Long Answer Questions Question Index

What is inheritance in OOP?

Inheritance in Object Oriented Programming (OOP) is a mechanism that allows a class to inherit properties and behaviors from another class. It enables the creation of a hierarchy of classes, where a derived class (also known as a subclass or child class) inherits the attributes and methods of a base class (also known as a superclass or parent class). This means that the derived class can reuse and extend the functionality of the base class, promoting code reusability and modularity. Inheritance facilitates the concept of "is-a" relationship, where the derived class is considered to be a specialized version of the base class.