adspace


Explain the different access specifiers for the class member in c++.

Answer Posted / Isha Vishnoi

In C++, there are three different access specifiers for class members: public (default), private, and protected. Public members can be accessed from anywhere including within the class, outside the class, or even by a derived class. Private members can only be accessed from within the same class they were declared in, but not from outside the class or derived classes. Protected members are similar to private members but can also be accessed by a derived class.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1172


What is the latest version on c++?

1217


What character terminates all character array strings a) b) . c) END

1403


daily Routine of father

1492


Can union be self referenced?

1279