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


    Question

    Which OOP principle is most closely related to the

    concept of "information hiding"?
    A Polymorphism Correct Answer Incorrect Answer
    B Inheritance Correct Answer Incorrect Answer
    C Abstraction Correct Answer Incorrect Answer
    D Encapsulation Correct Answer Incorrect Answer
    E Composition Correct Answer Incorrect Answer

    Solution

    While abstraction hides complexity, encapsulation specifically refers to bundling data (attributes) and methods (functions) that operate on the data into a single unit (class) and restricting direct access to some of the object's components (information hiding), typically through access modifiers like private.

    Practice Next
    ask-question