The Private keyword is a member access modifier, and private access is the lowest level allowed for access, and private members are only accessible to the class and struct in which they are accessed.
For example, in the following example, the Employee class contains two private data members, name and salary, and private members can only be accessed through member methods, so a public method named GetName and salary is added, allowing access to the private member to be controlled. The name member is accessed through public methods, and the salary member is accessed through a public read-only property.
usingSystem;classemployee{Private stringName ="FirstName, LastName"; Private DoubleSalary =100.0; Public stringGetName () {returnname; } Public DoubleSalary {Get{returnsalary;} }}
The Public keyword is a type and type member access modifier, which is the highest level of access allowed, with no restrictions on access to public members.
The protected keyword is a member access modifier, and access is limited to types that are derived from the containing class and the containing class.
The internal keyword is an access modifier for a type and a member of a type, and only the internal type or member is accessible in a file of the same assembly.
This is the description of internal on MSDN, with the types enum (enum), Class (classes), Interface (interface), struct (struct).
Type members have functions, member variables such as functions and member variables, and so on.
Protect internal can only be used in this class, derived classes, or assemblies that contain the class.
c#public_private_protected_internal_protected Internal