Java Reference
In-Depth Information
Looking at the Java API specifications
Bring up the specifications in some browser. You will see something similar
to the page that is displayed in Fig. II.1. The small pane on the upper left con-
tains a list of the Java packages, and the pane on the lower left contains a list of
all the classes in those packages (as well as items called
interfaces
; we do not
deal with them now). Both of these panes are scrollable, so you can easily find
what you are looking for (if you know what that is).
The main pane on the right contains a horizontal button bar, whose items are
fairly self-explanatory. (
Deprecated
means
lessened in value
, and Java uses the
term for classes and methods that have been superceded by better ones. You can
still use the deprecated ones, and we do from time to time.) The lower part of the
main pane contains a list of packages in the Java API.
Here is how we usually work to access the spec of a particular class, say
Math
, in package
java.lang
. First, use the scroll bar in the upper left pane to
make
java.lang
visible. Click on
java.lang
. The lower left pane will change
to show only the interfaces and classes in that package. Now, use the scroll bar
in the lower left pane to make
Math
visible and click on it. When the main pane
changes, scroll down a bit until it looks like Fig. II.2.
In the main pane, you now see a description of class
Math
. Scroll down
slowly, and you will see a “summary” of the fields and of methods. These sum-
maries tell you a little about the fields and methods of the class. For example, the
Figure II.3:
Extensive description of function abs
Search WWH ::
Custom Search