For Asp.net Training with C# Click Here
Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com
Access
specifier in C#
Access specifier defines the accessibility of class member.
We can restrict and limit the accessibility of member of classes.
Access
Specifier and their accessibility
Access Spicifier
|
With in class
|
Derived Class
|
Outside Class
|
With in Assembly
|
Public
|
Yes
|
Yes
|
Yes
|
Yes
|
Private
|
Yes
|
No
|
No
|
No
|
Protected
|
Yes
|
Yes
|
No
|
No
|
Internal
|
Yes
|
No
|
No
|
Yes
|
Protected internal
|
Yes
|
Yes
|
No
|
yes
|
Above table defines the accessibility of all access
spicifier. As this table describe that public member can be accessd everywhere
and private accessed only with in class. This create the protection level that except the class member no other can
access the private member of class.