Access Specifiers:
Public : Available to everyone
Private : Class members declared as private can be used only by member functions and friends (classes or functions) of the class.
If someone tries to access a private member, they’ll get a compile-time error.
Protected : Class members declared as protected can be used by member functions and friends (classes or functions) of the class. Additionally, they can be used by classes derived from the class.
No comments:
Post a Comment