Private,public and protected are access specifiers..They are usually specified after the declaration after of data members.
public,protect,private are "access specifiers" .whenever we declare the variables under private it is not possible to access those variables out side the class.where as in public it is possible to access.
public,protect,private are "access specifiers" .whenever we declare the variables under private it is not possible to access those variables out side the class.where as in public it is possible to access.
public, protect and private are access specifiers, when a variable declared as private, it cannot be accessed outside the class. when a variable declared as public it can be accessed outside the class.
Member variables and member functions that are listed in a protected section of the interface definition are treated as though they were private, with one important exception: member functions of derived classes can access them when they occur as the base class part of a derived class object.
The private,public & protected are access specifiers in C++ 1) private :- you will not have access outside the class 2) public :- You will have access outside the class 3) Protected :- You will have access within same class and derived class.