What is private protected access modifier

By | November 22, 2017

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.

One thought on “What is private protected access modifier

  1. buy cialis

    Your method of explaining everything in this article
    is actually good, every one be able to easily be aware of it,
    Thanks a lot.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *