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


    Question

    In C++, which access specifier allows members to be

    accessible only within the class?
    A private Correct Answer Incorrect Answer
    B public Correct Answer Incorrect Answer
    C protected Correct Answer Incorrect Answer
    D default Correct Answer Incorrect Answer
    E internal Correct Answer Incorrect Answer

    Solution

    private members cannot be accessed outside the class, ensuring encapsulation.

    Practice Next
    ask-question