What is public , private , protected ?
Public :- It is an access specifier that uses to access the only members of its own class. It is used to hide data inside a class, so that it is not accessed mistakenly by any function outside the class.
private :- The public access specifier is used to access the object of the class in addition to their own class member as well as accessed from outside the class.
protected :- This access specifier is used to access the members of inherited class.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment