Sunday, 28 April 2013

What are the different accessibility levels defined in .NET? | C#.Net Interview Questions

Following are the five levels of access modifiers :-
 Private : Only members of class have access.
 Protected : All members in current class and in derived classes can access the variables.
 Friend (internal in C#) : Only members in current project have access to the elements.
 Protected friend (protected internal in C#) :  All members in current project and all members in derived class can access the variables.
 Public : All members have access in all classes and projects.

No comments: