Java contains an extensive library of pre-written classes you can use in your programs. These classes are divided into groups called packages.
java.applet
java.awt
java.awt.datatransfer
java.awt.event
java.awt.image
java.awt.peer
java.beans
java.io
java.lang
java.lang.reflect
java.math
java.net
java.rmi
java.rmi.dgc
java.rmi.registry
java.rmi.server
java.security
java.security.acl
java.security.interfaces
java.sql
java.text
java.util
java.util.zip
Each package defines a number of classes, interfaces, exceptions, and errors.
Packages can be split into sub-packages. for example, the
java.lang
package has a sub-package called
java.lang.reflect
. These are really completely different
packages. A class in a sub-package has no more access to a class in
the parent package (or vice versa) than it would to a class in a
completely different package.