Which Feature of OOP boost the code reusability?OptionsPolymorphismInheritanceEncapsulationAbstraction
Question
Which Feature of OOP boost the code reusability?OptionsPolymorphismInheritanceEncapsulationAbstraction
Solution
The feature of Object-Oriented Programming (OOP) that boosts code reusability is Inheritance.
Here's why:
-
Inheritance is a mechanism in which one class acquires the property of another class. For example, a child inherits the traits of their parents. With inheritance, we can reuse the fields and methods of the existing class. Hence, inheritance facilitates reusability and is an important concept of OOP.
-
Inheritance allows us to define a class in terms of another class, which makes it easier to create and maintain an application. This also provides an opportunity to reuse the code functionality and speeds up implementation time.
-
When a class includes property of another class, it is known as inheritance. This is used for code reusability and method overriding. The class whose properties are inherited is known as the Parent class or Base class, and the class which is inheriting the properties is known as the Child class or Derived class.
So, the answer is Inheritance.
Similar Questions
10Which Feature of OOP encourages code reusability?Review LaterPolymorphismInheritanceAbstractionEncapsulation
Which of the following OOP concept binds the code and data together and keeps them secure from the outside world?OptionsPolymorphismInheritanceEncapsulationAbstraction
5. Which feature of OOP indicates code reusability?a) Abstractionb) Polymorphismc) Encapsulationd) Inheritance
Which Feature of OOP illustrated the code re-usability?Select one:PolymorphismAbstractionEncapsulationInheritance
______is implemented as Combination of methods and attributes into a class.OptionsInheritanceEncapsulationPolymorphismAbstraction
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.