Packages contain names were classes are stored.
To represent multi packaging
Package pkgx [.pkgy [.pkgz]];
Package java.awt.image a;
Finding of packages
There are three ways to find the packages. The java runtime system uses the working direct-
ory; if the package is contained in the sub directory then it will be discovered or you can set
the location by setting the location of class as shown .
It can use class path with java as well as javac to specify the location of class as shown .
C: \ myprograms\java\mpack
For the protection of packages there are three specifiers in existence in java.
Private- cannot be seen or accessed from outside the class.
Public- it has feature to be accessed from anywhere.
Protected- this can be accessed only by classes which are sub-classes.
Importing a package