Question:

Write any two advantages of using OOP.

Show Hint

OOP allows the use of abstraction, inheritance, and polymorphism, which lead to more efficient and maintainable software development.
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Step 1: Encapsulation.
OOP allows the bundling of data (attributes) and methods (functions) into a single unit known as a class. This helps in protecting the data from unauthorized access and modification, ensuring that only appropriate methods can manipulate the data.
Step 2: Inheritance.
OOP promotes reusability through inheritance, where a new class can inherit properties and methods from an existing class. This reduces redundancy and allows code to be reused, which makes the codebase more maintainable.
Was this answer helpful?
0
0