Java Reference
In-Depth Information
Next, if you switch to the Windows environment and double click on the file
Clock.html , it shows you the Java style documentation of the class Clock shown in
Figure D-20.
FIGURE D-20 Java style documentation of the class Clock
Creating Your Own Packages
Recall that a package is a collection of related classes. As you develop classes, you can
create packages and categorize your classes. You can import your classes in the same way
that you import classes from the packages provided by Java.
To create a package and add a class to the package so that the class can be used in a
program, you do the following:
1. Define the class to be public . If the class is not public , it can be used only within
the package.
2. Choose a name for the package. To organize your package, you can create subdir-
ectories within the directory that contains the compiled code of the classes. For
 
Search WWH ::




Custom Search