Access Modifiers

What are Access Modifiers in C#? C# Access Specifiers

Access modifiers, also known as access specifiers, define the scope of accessibility for objects and their members within a class. They provide a mechanism to control the visibility and accessibility of class members. There are five distinct levels of accessibility that can be specified using access modifiers:

public, private , protected , internal and protected internal

public: Access level is not restricted.

protected: Access level is limited to the containing class or types derived from the containing class.

What are the Default Access Modifiers in C# ?

Internal: Access level is limited to the current assembly.

protected internal: Access level is limited to the current assembly or types derived from the containing class.

private: Access level is limited to the containing type.

If no modifier is specified, the method is given private access.

You can see here more details about... Access Specifiers