| |
GeekInterview.com > Tech FAQs > OOPS
| Print | |
Question:
What do you mean by public, private, protected and friendly?
|
| January 01, 2006 07:21:09 |
#1 |
| Sameeksha |
Microsoft Expert Member Since: October 2005 Total Comments: 231 |
RE: What do you mean by public, private, protected an... |
These are access specifiers for class data members and member methods. - Public: The data members and methods having public as access specifier can be accessed by the class objects created outside the class.
- Protected: The data members and methods declared as protected will be accessible to the class methods and the derived class methods only.
- Private: These data members and methods will be accessible from the class methods only, not from derived classes and not from objects created outside the class.
- Internal: Some languages define internal as an access specifier which means the data member or method is available to all the classes inside that particular assembly.
- Friend: A friend class or method can access all data of a class including private and protected data.
|
| |
Back To Question | |