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


    Question

    Which access specifier allows data to be accessed only

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

    Solution

    The private access specifier restricts access to members only within the same class.

    Practice Next
    ask-question