Hi Friends....
I have confusion about these terms i.e. public, private, protected in .net but I want, anyone explain public, private, protected in details with real life example ?
Thanks....
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Jan 20, 2012, 11:25 PM
Access modifiers are keywords used to specify the declared accessibility of a member or a type. This section introduces the four access modifiers:
Public - Access is not restricted.
Protected - Access is limited to the containing class or types derived from the containing class.
Internal - Access is limited to the current assembly.
Protected inertnal - Access is limited to the current assembly or types derived · from the containing class.
Private - Access is limited to the containing type.
For example Please refer the below links
public:-http://msdn.microsoft.com/en-us/library/yzh058ae(v=vs.71).aspx
protected:-http://msdn.microsoft.com/en-us/library/bcd5672a(v=vs.71).aspx
private:-http://msdn.microsoft.com/en-us/library/st6sy9xe(v=vs.71).aspx
internal:-http://msdn.microsoft.com/en-us/library/7c5ka91b(v=vs.71).aspx
Thanks