Disable ads (and more) with a membership for a one time $2.99 payment
What does inheritance primarily allow for in OOP?
Name control
Dynamic memory management
Reusability and extension of existing implementations
Error handling
The correct answer is: Reusability and extension of existing implementations
Inheritance is a fundamental concept in object-oriented programming (OOP) that allows for code reuse and extension. It allows a new class to be based on an existing class, inheriting its fields and methods. This means that the new class has access to all the functionality of the parent class, while also having the ability to add its own unique features and functionality. This makes inheritance a powerful tool for creating efficient and maintainable code. Option A, Name control, is not a term commonly used in relation to inheritance in OOP. Option B, Dynamic memory management, is not a primary purpose of inheritance, although it may be indirectly related to it in some cases. Option D, Error handling, is not a primary purpose of inheritance, although it may be used in conjunction with it in some cases. The primary purpose of inheritance is to promote code reuse and extension.