7.4.3
Scope and Hiding of a Package Name
PACKAGES
about situations in which a named package is used by more than one unnamed
package. It is specifically not required indeed, it is strongly discouraged for an
implementation to support use of a named package by more than one unnamed
package by maintaining multiple compiled versions of the named package.
7.4.3 Scope and Hiding of a Package Name
Which top level package names are in scope ( 6.3, 6.5) is determined by con
ventions of the host system.
Package names never hide other names.
7.4.4 Access to Members of a Package
Whether access to members of a package is allowed is determined by the host sys
tem. The package
java
should always be accessible, and its standard subpackages
lang
,
io
, and
util
should always be accessible.
It is strongly recommended that the protections of a file system or database
used to store Java programs be set to make all compilation units of a package
available whenever any of the compilation units is available.
7.5 Import Declarations
An
import declaration
allows a type declared in another package to be referred to
by a simple name ( 6.2) that consists of a single identifier. Without the use of an
appropriate
import
declaration, the only way to refer to a type declared in another
package is to use its fully qualified name ( 6.7).
ImportDeclaration:
SingleTypeImportDeclaration
TypeImportOnDemandDeclaration
A single type import declaration ( 7.5.1) imports a single type, by mention
ing its fully qualified name. A type import on demand declaration ( 7.5.2)
imports all the
public
types of a named package as needed.
An
import
declaration makes types available by their simple names only
within the compilation unit that actually contains the
import
declaration. The
scope of the name(s) it introduces specifically does not include the
package
state
ment, other
import
statements in the current compilation unit, or other compila
tion units in the same package. Please see 7.5.4 for an illustrative example.
120
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved