Access Modifiers in C# with example program
Access Modifiers in C#:
C# provides a set of Access Modifiers that can be used with the members of a class to control their visibility to outside users. These are:
1. public: In public access modifiers, the member is accessible from anywhere outside the class as well. It is also accessible in derived classes.
2. private: In private access modifiers, the member is accessible only within the class containing the member.
3. protected: In protected access modifiers, the member is visible only to its class and its derived classes.
4. internal: In internal access modifiers, the member is available within the assembly or component.
5. protected internal: In protected internal, the available member in the containing program or assembly and the derived classes.