Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

which of the following is not a benefit of using oop? code reusability …

Question

which of the following is not a benefit of using oop?
code reusability
modularity
increased code complexity
maintainability
question 10
1 pts
what is the purpose of a getter method in encapsulation?
to modify a private attribute.
to access the value of a private attribute.
to delete a private attribute.
to create a new private attribute.
question 11
1 pts
what is the purpose of a setter method in encapsulation?
to access the value of a private attribute.
to modify a private attribute.
to delete a private attribute.
to create a new private attribute.

Explanation:

Brief Explanations
  • For the first question: OOP benefits include code reusability, modularity, and maintainability. Increased code complexity is a potential drawback, not a benefit.
  • For Question 10: Getter methods in encapsulation allow controlled access to the value of private attributes without modifying them.
  • For Question 11: Setter methods in encapsulation enable controlled modification of private attributes while maintaining data integrity.

Answer:

First question: Increased code complexity
Question 10: To access the value of a private attribute.
Question 11: To modify a private attribute.