Package-private
This describes the access level of the Java class in the official guidance:
At the top level-public, or package-private (no explicit modifier).
At the member Level-public, private, protected, or package-private (no explicit modifier).
Do not know what package-private is, so continue to look down, see such a passage:
A class may being declared with the modifier public, in which case, which is visible to all classes everywhere. If A class has no modifier (the default, also known as Package-private), it's visible only within its own package (Packag ES is named groups of related Classes-you would learn about them in a later lesson.)
Presumably, when a class does not have any access modifiers, his default access level is Package-private, which means that the other classes within the package are visible, and the classes outside the package are invisible, which is what we often call the packages level.
Access levels
|
Modifier |
Class |
Package |
Subclass |
World |
| Public |
Y |
Y |
Y |
Y |
| Protected |
Y |
Y |
Y |
N |
| No modifier |
Y |
Y |
N |
N |
| Private |
Y |
N |
N |
N |
Access levels for Java classes