C# Access Modifiers

Question posted in Computer Software on 09 2009
Rate question difficulty level 0 Votes
please state the access modifers in c# and explain in few words each of them.
 
 
1 Answer
 
Public
The public keyword is an access modifier for types and type members. Public access is the most permissive access level. There are no restrictions on accessing public members.

Protected
The protected keyword is a member access modifier. A protected member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member.A protected member of a base class is accessible in a derived class only if the access takes place through the derived class type

Internal
The internal keyword is an access modifier for types and type members. Internal members are accessible only within files in the same assembly.

Private
The private keyword is a member access modifier. Private access is the least permissive access level. Private members are accessible only within the body of the class or the struct in which they are declared.

Nested types in the same body can also access those private members.


09/22/2009
 
 
Add an answer*
 
Email
Location: Glil-Yam , Israel
C# C Sharp Modifiers
Now hiring!
Intuit 
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------