Finally, with C# 7.2 we get a new compound access modifier: private protected indicates that a member may be accessed by derived classes that are declared in the same assembly. While protected internal allows access by derived classes or classes that are in the same assembly, private protected limits access to derived types declared in the same assembly
With this now we have following six accessibility levels that can be specified using the access modifiers:
public: Access is not restricted.
protected: Access is limited to the containing class or types derived from the containing class.
internal: Access is limited to the current assembly.
protected internal: Access is limited to the current assembly or types derived from the containing class.
private: Access is limited to the containing type.
private protected: Access is limited to the containing class or types derived from the containing class within the current assembly.
With this now we have following six accessibility levels that can be specified using the access modifiers:
public: Access is not restricted.
protected: Access is limited to the containing class or types derived from the containing class.
internal: Access is limited to the current assembly.
protected internal: Access is limited to the current assembly or types derived from the containing class.
private: Access is limited to the containing type.
private protected: Access is limited to the containing class or types derived from the containing class within the current assembly.
Comments
Post a Comment