Java Reference
In-Depth Information
7.4.3. Observability of a Package
A package is
observable
if and only if either:
• A compilation unit containing a declaration of the package is observable (§
7.3
).
• A subpackage of the package is observable.
The packages
java
,
java.lang
, and
java.io
are always observable.
One can conclude this from the rule above and from the rules of observable compila-
tion units, as follows. The predefined package
java.lang
declares the class
Object
, so the
exists, hence the
java.io
package is observable.
7.5. Import Declarations
An
import declaration
allows a named type or a
static
member to be referred to by a simple
Without the use of an appropriate
import
declaration, the only way to refer to a type declared
in another package, or a
static
member of another type, is to use a fully qualified name
ImportDeclaration:
SingleTypeImportDeclaration
TypeImportOnDemandDeclaration
SingleStaticImportDeclaration
StaticImportOnDemandDeclaration
name of a type or package.
with a given name from a type, by giving its canonical name.
bers of a named type as needed, by mentioning the canonical name of a type.