C# Access Modifiers

Last Updated on June 11, 2022
C# Access Modifiers

C# Access Modifiers

In C# access modifiers are applied to any of the class, properties, methods other members to give accessibility to those members of the class and its members.

There are the following access modifiers in C#.

Modifier Description
public The code is accessible for all classes
private The code is only accessible within the same class
protected The code is accessible within the same class, or in a class that is inherited from that class
internal The code is only accessible within its own assembly, but not from another assembly