Significance of access specifiers in a class
In C++ a class provides three access labels namely , private, protected and public.
A member declared as private or protected in C++ remains hidden from world and it can only be accessed by the member functions of the class itself.
A member declared as public in C++ program is made available to the outside world. Basically it can accessed by any member functions of the class , by nay expression in the program but only by using a object of the same class type.
The labels listed enforces the data hiding and abstraction, oop concepts in C++
No comments:
Post a Comment