Title: Key Concept - Packages
Course: CPS 189: Java Certification - Review, Practice & Prepare (Development) > Section: Learning Modules

Java Packages

Below is a list of important concepts about a Java package:

- A package is a set of related classes and interfaces.
- A package may also contain:
  - Enumerations which are a special category of classes.
  - Annotation types which are special category of interfaces.
- Each class and interface within a package is known as a member.
- A large collection of packages is already defined in the Java Platform API.
- Any member of a public package may be used in a Java program by:
  - Using the member’s fully qualified name.
  - Importing the member with the import statement.
  - Importing the member’s package with the import statement.
- The java.lang package, defined in the Java Platform API, is the only package that is automatically imported into every Java program.
- A package is stored in a compressed format called a .JAR file.
- Every .JAVA file within a Java program must be part of a package.
- The package statement must be the first executable statement within a .JAVA file.