Hiding thinking in Java 1.3 implementation solution 【]:
Public: [public] means that subsequent definitions can be used by anyone.
PRIVATE: [private] means that no one except yourself, the creator of the type, and the member of the internal function of that type can access subsequent definition information.
Friendly: [friendly] involves the concept of "packaging" or "package"-that is, the method Java uses to build a library. Something is "friendly", meaning it can only be used within the packaging range (so this access level is also
It is called "package access ").
Protected: [protected] is similar to "private". It is only an inherited class that can access protected members, but cannot access private members.
Summary:
Public: All packages are accessible.
PRIVATE: in this class.
Friendly: default value. It can only be accessed in the middle of the package.
Protected: The subclass can be accessed.