The number of access specifiers in class of C++ is
2023
The number of access specifiers in class of C++ is
- A.
2
- B.
3
- C.
4
- D.
More than one of the above
- E.
None of the above
Attempted by 568 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.