|
Public, protected, friend, and private define the access rights of members in the class.
Other members, subclasses, instances, and friends of the public class can all be accessed
Other members of the protected class, subclasses can access
Other members of the friend class, the friend class can visit
Other members in the private class can access
Shared declares that members are shared, which is equivalent to static (static) in c++, c#, and java, and cannot be accessed in the instance. It can only be accessed by type. And its value is shared. Can be modified. This point is completely different from const. |
|