The public keyword is an access modifier for type and type members. Public access is the highest allowed access level, and there is no restriction on access to public members.
The protected keyword is a member access modifier. Protected members can be accessed in their classes and can be accessed by Derived classes.
The private keyword is a member access modifier. Private access is the minimum allowed access level. Private Members are accessible only when their classes and struct are declared.
Internal keywords are access modifiers for type and type members. Internal types or members are accessible only in files of the same assembly.
Public means that all members declared after it can be retrieved from all users.
The private keyword means that no one except the creator of this type and the internal member functions of the class can access these members.
Protect is similar to private. There is only one difference: the inherited structure can access the protected member, but cannot access the private member.
========================================================== =====
Public is visible to all other programs, subprograms, and programs other than the package.
Private is the opposite. It is invisible to anyone except yourself.
Protect is visible to the same package and subprograms
You are the current program.
Which program is your privat variable and method? This program is your own.
========================================================== =====
Public has a good affinity,
Protect is only good for acquaintances,
Private is private.
But they are triplets.
Class is their father.
This article is from the son of the Sea blog, please be sure to keep this source http://4769069.blog.51cto.com/4759069/1215892