Java Reference
In-Depth Information
might be mapped to the directory name:
children/activities/crafts/papierM@00e2ch@00e9
If the @ character is not a valid character in a file name for some given host file sys-
tem, then some other character that is not valid in a identifier could be used instead.
7.3. Compilation Units
CompilationUnit is the goal symbol (§ 2.1 ) for the syntactic grammar (§ 2.3 ) of Java pro-
grams. It is defined by the following productions:
CompilationUnit:
PackageDeclaration opt ImportDeclarations opt TypeDeclarations opt
ImportDeclarations:
ImportDeclaration
ImportDeclarations ImportDeclaration
TypeDeclarations:
TypeDeclaration
TypeDeclarations TypeDeclaration
A compilation unit consists of three parts, each of which is optional:
• A package declaration (§ 7.4 ), giving the fully qualified name (§ 6.7 ) of the package
to which the compilation unit belongs.
A compilation unit that has no package declaration is part of an unnamed package
7.4.2 ) .
import declarations (§ 7.5 ) that allow types from other packages and static members
of types to be referred to using their simple names.
• Top level type declarations (§ 7.6 ) of class and interface types.
Every compilation unit implicitly imports every public type name declared in the predefined
package java.lang , as if the declaration import java.lang.*; appeared at the beginning of each
compilation unit immediately after any package statement. As a result, the names of all those
types are available as simple names in every compilation unit.
All the compilation units of the predefined package java and its subpackages lang and io are
always observable .
For all other packages, the host system determines which compilation units are observable.
Search WWH ::




Custom Search