prev next prev next
  Course navigation
  Lesson 2 Understanding packages
 
Objective
Examine packages and the role they play in Java class organization.
To aid in the organization of classes, Java provides a construct known as a package that is used to organize classes into functionally-related groups. Packages don't directly impact the internal makeup of a class but they do impact the relationship between classes.
What to remember about Java packages
  1. All of the classes in the Java API are organized into a group of packages.
  2. The standard java.lang package is the only package that is automatically imported into every Java program.
  3. Packages help you uniquely identify classes. The package to which a class belongs is implicitly part of the class name.
    So the standard Java class Graphic is really named java.awt.Graphics. This identification helps to provide structure to all Java classes.
  Course navigation