📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    Which of the following is a benefit of

    encapsulation?
    A Reduces code reusability. Correct Answer Incorrect Answer
    B Increases coupling between objects. Correct Answer Incorrect Answer
    C Improves security and data integrity. Correct Answer Incorrect Answer
    D Makes debugging more difficult. Correct Answer Incorrect Answer
    E Eliminates the need for inheritance. Correct Answer Incorrect Answer

    Solution

    By controlling access to internal data, encapsulation prevents unauthorized or incorrect modifications, thereby improving the security and integrity of the object's state. It also reduces coupling and makes code easier to maintain.

    Practice Next
    ask-question