Public means that all members declared after it can be retrieved from all users.
Private 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 has a good affinity,
Protect is only good for acquaintances,
Private is private.
But they are triplets.
Class is their father.
========================================================== ====
Public: the restroom in the public restroom, which can be used by everyone.
Protect: the restroom in your home can be used as long as it is regarded as your own family.
PRIVATE: You are an infectious disease person. You cannot use your own toilet or your own toilet.
Friend can access private.
Friend is like if he is your boyfriend or girlfriend, he can make an exception, but this exposes your privacy and should not be promoted.