protected: The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.internal: The type or member can be accessed by any code in the same assembly, but not from another assembly. The "protected internal" access modifier is a union of both the "protected" and "internal" modifiers. From MSDN, Access Modifiers (C# Programming Guide): The type or member can be accessed by any code in the assembly in which it is declared, OR from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.Note that: protected internal means "protected OR internal " (any class in the same assembly, or any derived class - even if it is in a different assembly).private The type or member can be accessed only by code in the same class or struct.public The type or member can be accessed by any other code in the same assembly or another assembly that references it. |
Sunday 16 May 2021
Access spcifiers in C#
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment