JLS: Chapter 7. Packages:
A package consists of a number of compilation units (§7.3). A compilation unit automatically has access to all types
Actually the issue is about simple type names:
6.5.5.1 Simple Type Names If a type name consists of a single Identifier, then the identifier must occur in the scope of exactly one visible declaration of a type with this
About scope we can read here:
(6.3) The scope of a declaration is the region of the program within which the entity declared by the declaration can be referred to using a simple name, provided it is visible
..
The scope of a type imported by a single-type-import declaration (§7.5.1) or a type-import-on-demand declaration (§7.5.2) is all the class and interface type declarations (§7.6) in the compilation unit in which the import declaration appears, as well as any annotations on the package declaration (if any) of the compilation unit .