What is the main purpose of inheritance in object-oriented programming?
Show answerHide answer
Correct answer: (D) Code reusability
Explanation
Inheritance lets a subclass reuse the fields and methods of an existing class, so its main purpose is code reusability.