Which OOP principle allows a class to acquire the properties and methods of another class?

Options

  • A. Encapsulation
  • B. Inheritance
  • C. Abstraction
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. Inheritance

Detailed Explanation

Explanation: Inheritance allows a derived class (child class) to acquire the properties and methods of an existing base class (parent class). It promotes code reuse and hierarchical classification.