Specifications

Sun Services
Java™ Programming Language
Module 2, slide 19 of 26
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
The package Statement
Basic syntax of the package statement is:
package
<top_pkg_name>[
.
<sub_pkg_name>]*
;
Examples of the statement are:
package shipping.gui.reportscreens;
Specify the package declaration at the beginning of the
source file.
Only one package declaration per source file.
If no package is declared, then the class is placed into
the default package.
Package names must be hierarchical and separated by
dots.