Java Reference
In-Depth Information
The package
java
is always in scope.
The scope of a type imported by a single-type-import declaration (§
7.5.1
) or a type-import-
compilation unit in which the
import
declaration appears, as well as any annotations on the
package declaration (if any) of the compilation unit.
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.
level type is declared.
is the entire body of
C
, including any nested type declarations.
The scope of a declaration of a member
m
declared in or inherited by an interface type
I
The scope of an enum constant
C
declared in an enum type
T
is the body of
T
, and any
case
label of a
switch
statement whose expression is of enum type
T
.
body of the method or constructor.
The scope of a class's type parameter (§
8.1.2
) is the type parameter section of the class
declaration, the type parameter section of any superclass or superinterface of the class de-
claration, and the class body.
terface declaration, the type parameter section of any superinterface of the interface declar-
ation, and the interface body.
including the type parameter section, but excluding the method modifiers.
structor, including the type parameter section, but excluding the constructor modifiers.
The scope of a local class declaration immediately enclosed by a block (§
14.2
) is the rest
of the immediately enclosing block, including its own class declaration.