The number of access specifiers in class of C++ is

2023

The number of access specifiers in class of C++ is

Answer: B. 3In C++, access specifiers are used to control the visibility of class members. There are three access specifiers: public, private, and protected. These…

  1. A.

    2

  2. B.

    3

  3. C.

    4

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 877 students.

Show answer & explanation

Correct answer: B

In C++, access specifiers are used to control the visibility of class members. There are three access specifiers: public, private, and protected. These determine whether members can be accessed from outside the class or only within the class or derived classes. Therefore, the number of access specifiers in a C++ class is 3.

Explore the full course: Bpsc

Loading lesson…