Different access modifiers in C#?
There are four access modifiers in C# which can control the access over the class members and functionalities as a part of data Encapsulation. They are:
- public - accessible for all classes
- private - Only accessible within the same class
- protected - accessible within the same class, or in a class that is inherited from that class.
- internal - only accessible within its own namespace, but not from another namespace.
Posted May 14, 2021