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


    Question

    Which of the following is a common mechanism to achieve

    abstraction in OOP?
    A Public methods Correct Answer Incorrect Answer
    B Private variables Correct Answer Incorrect Answer
    C Abstract classes and interfaces Correct Answer Incorrect Answer
    D Constructors Correct Answer Incorrect Answer
    E Static methods Correct Answer Incorrect Answer

    Solution

    Abstract classes and interfaces define a contract (what methods a class should have) without providing full implementation details, thereby enforcing abstraction. Public methods expose functionality, but don't inherently enforce abstraction as a design principle.

    Practice Next
    ask-question