Multiple choice

How many levels of accessibility are offered by classes?

  1. 2

  2. 3

  3. 4

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Classes in C++ offer three levels of accessibility: public (accessible from anywhere), private (accessible only within the class), and protected (accessible within the class and derived classes). These three access specifiers form the foundation of encapsulation in object-oriented programming.