Pages

Wednesday 3 April 2013

Different types of Access Modifiers

Access Modifier
Description (who can access)
private
Private members are accessible only within the body of the class or the struct in which they are declared.
protected
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.
internal
Internal members are accessible only within files in the same assembly
protected internal
Either code from derived type or code in the same assembly. Combination of protected OR internal.
public
There are no restrictions on accessing public members.

No comments:

Post a Comment