The access modifier is used define the accessibility of a member or type. The c# access modifiers are five types. They are,
- Public
- Protected
- Private
- Internal
- protected internal
Public - There is no restriction on accessing public modifier. The public method or type can be access from different assembly.
Protected - The protected method or type can be accessed from same class and derived class of that class.
Private - The private can be accessed only from that class.
Internal - The internal can be accessed from same name assembly but not by some other assembly like public.
Protected internal - The protected internal can be accessed by same assembly and derived assembly.