C #LearningClass access modifier. Class, the same assembly, the same assembly, other classes, different assembly, the derived classes, different assembly, and other classes ......
Priavte Protected Internal Public |
Public: The method to select it is to include the public modifier in the member declaration. The intuitive meaning of public is "unrestricted access ".
Protected: The method to select it is to include the protected modifier in the member declaration. The intuitive meaning of protected is "the access scope is limited to the class to which it belongs or the type derived from this class ".
Internal (default). The method to select it is to include the internal modifier in the member declaration. The intuitive meaning of internal is that "access scope is limited to this program ".
Protected internal (meaning protected or internal). The method to choose it is to include the Protected and internal modifiers in the member declaration. The intuitive meaning of protected internal is "access scope is limited to this program or the types derived from the classes it belongs ".
Private: the method to select it is to include the private modifier in the member declaration. The intuitive meaning of private is that "access scope is limited to the type it belongs ".