Access specifiers specify how the members of a class (data members and member functions) can be accessed. They enable us to determine which class members are visible to other classes and functions and which are not.
C++ includes three access specifiers:
Members who have been declared as public can be accessed from anywhere in the program, both inside and outside of class.
Members marked as private can only be accessed from within the same class, rendering them not accessible from outside.
Members selected as protected are available inside the same class and by derived classes, but not from other classes.