Fifth International World Wide Web Conference
Packages
- Java classes are collected into groups, known as packages
- Used as a mechanism for grouping classes which
- perform related functions
- constitute a complete API specification
- To be part of a package, a Java class must begin with a
package
statementpackage osf.andyj;
- Class is a member of the default package (empty name) if no package name is
specified
- Package name used for locating the Java bytecode file
- interface specifications
- method implementations
- Dependent compilation model
- Class must be compiled before it can be imported
- No circular dependencies among classes
- Package name consists of one or more dot-separated identifiers
- used to construct a path to locate the bytecode for the class
- usually done via the file system directory structure
Java - An Introductory Language Tutorial
(E.A.Johnson)