Showing posts with label Access Speicfier. Show all posts
Showing posts with label Access Speicfier. Show all posts

Tuesday, 10 April 2012

Access specifier in C#


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.