Programs are organized as sets of packages. Each package has its own set of names for types, which helps to prevent name conflicts.
A top level type is accessible (§6.6) outside the package that declares it only if the type is declared
The naming structure for packages is hierarchical (§7.1). The members of a package are class and interface types (§7.6), which are declared in compilation units of the package, and subpackages, which may contain compilation units and subpackages of their own.
A package can be stored in a file system or in a database (§7.2). Packages that are stored in a file system may have certain constraints on the organization of their compilation units to allow a simple implementation to find classes ...