What is a Java package?

Here are some things various authors have said about Java packages:

  1. A package is a collection of related classes and interfaces providing access privileges and namespace management. [Campione, Walrath and Huml in The Java Tutorial]
  2. The package is Java's mechanism for managing namespaces. [A paraphrase of Eckel]
  3. A package is a convenient way of grouping together many different classes that have a common purpose. [Holmes]
  4. A package is a unique named collection of classes. [Horton]
  5. Packages, which comprise many classes, interfaces, or other packages, support hierarchical organization, and are used to organize large programs into logical and manageable units. [A paraphrase of Jia]
  6. Java packages are namespaces. They allow programmers to create small private areas in which to declare classes. The names of those classes will not collide with identically named classes in different packages. [Martin]

How is a Java package named, created and stored?

How is a Java package used?

What about the standard Java packages?

Some things to remember about Java packages ...