Access specifier

Class access specifier there are four:

the  public

protect

default default (i.e., without any modifiers)

private

 

Within a class, all the members can access each other, transparent access specifier, access specifier for a foreign class terms.

 

External Access includes two ways:

by members of the class name to access the inside of the class

through the class object class name to access internal members

 

public

It can be accessed by internal and external access to the public members of the class

 

private

Not by private external access to internal members access to class

Class object name. Private members name , this method can not access the private members object, the compiler error

Guess you like

Origin www.cnblogs.com/sunbr/p/11460065.html