The following five modifiers for class and Class members in C # are as follows:
Public exposes class and class members with no level restrictions on access members
The modifiers of private class members can only be accessed within the class
Protected the modifier of a protected class member can only be accessed in that class and in a derived class of that class, regardless of whether the derived class and base class are in the same assembly
Internal inside class and class members are restricted to assemblies
Protected internal What do you mean by the protected interior? Note that if the image is an inheritance relationship, whether it is accessible in the same assembly or not, it can only be accessed in the same assembly if it is not an inheritance relationship
The access rights of the class:
Modifiers that can be placed before class classes are only public and internal, and if no modifiers are written, the default is internal
Let's start with the access to the class: 1:public class: Anywhere the class can be accessed; 2:internal class: Only within the same assembly (you can understand this: if you build a solution with three projects in it, there are three assemblies, If you set a class in the first project to internal class, then it is not possible for the second project to call this class, because it is not in the same assembly, it can be accessed;
Access rights for Class Members:
The access rights of a class member can consist of four modifiers: public,private, protected,internal,protected internal; If no modifier is written before the class member, the default is private.
Their access rights I found a picture on the internet, and I posted this picture, which is a good illustration of the access rights of class members.
4 access modifiers in C #