Access modifiers are keywords used to specify the declared accessibility of a member or a type.
private : Private means hidden and usable only by the class itself. No code using a class instance can access a private member and neither can a derived class.
public : Public means visible to everyone and everywhere.
protected : Protected members are similar to private ones in that they are accessible only by the containing class. However, protected members also may be used by a descendant class.
Internal: Internal are public to the entire assembly but private to any outside assemblies. Internal is useful when you don't want to allow other assemblies to have the functionality.
protected internal: Protected internal is the same access levels of both protected and internal. It can access anywhere in the same assembly and in the same class also the classes inherited from the same class.
Home
private : Private means hidden and usable only by the class itself. No code using a class instance can access a private member and neither can a derived class.
public : Public means visible to everyone and everywhere.
protected : Protected members are similar to private ones in that they are accessible only by the containing class. However, protected members also may be used by a descendant class.
Internal: Internal are public to the entire assembly but private to any outside assemblies. Internal is useful when you don't want to allow other assemblies to have the functionality.
protected internal: Protected internal is the same access levels of both protected and internal. It can access anywhere in the same assembly and in the same class also the classes inherited from the same class.
Home
No comments:
Post a Comment