Related types in Java are placed in a common package.
- A package provides a unique namespace for the types it contains.
- A package facilitates access protection.
- A package can contain the following kinds of types.
- Classes
- Interfaces
- Enumerated Types
- Annotations
A package is represented in Java code by a series of textual names delimited by the '.' (dot) character. e.g import java.awt.event.*;
And is stored on disk {or in a compressed file such as a jar or Ear (Enterprise Archive)} as a series of nested directories. e.g. /java/awt/event