C ා access modifier

Time:2020-4-5

Access modifier:

1. Public: all public classes can access

2. Private: the private current class can be accessed internally

3. Protected: the protected current class and its inherited subclasses can access

4. Internal: internal access is limited to this project, others cannot.

5. Protected internal: internal protection access can only be internal or subclass access of this project. Other classes cannot access

Access level constraints:

1. The access modifiers of the parent and child classes should be consistent

2. The access modifier of the method should be consistent with the access modifier of the method parameter

Default access level:

Class default access level: internal

Default access level for members of class and struct: private

Default level of interface members and enumerations: public

Recommended Today

Install mongodb using yum

Mongodb series: Install mongodb using yum Command operation of mongodb Programming operation of mongodb Install mongodb using Yum in CentOS 7. The installation package may not be the latest, but it must be the most stable. The advantages of Yum installation are simple, time-saving, labor-saving and efficient. If you want to install the latest version […]