Java Reference
In-Depth Information
Using the Java API (continued)
site. (Or, if you downloaded the documentation from the CD that accompanies
this topic, navigate to the installed version of the Java SDK on your system.
Open the index.html file in the docs\api folder.)
The Java API is organized by the packages, hierarchically, but many pro-
grammers click the Index link located at the top of the page to display the entire
list alphabetically. With the Java API Specification open in the browser window,
perform the following steps:
1. Use the scroll down arrow in the top left frame of the main frame to display
the java.util link. Click the java.util link.
2. When the Package java.util page is displayed in the lower-left frame, if neces-
sary, scroll down to display the list of Classes. Click ArrayList in the list of
Classes.
3. When the Class ArrayList page is displayed, read the first four paragraphs,
including those that describe the capacity of an ArrayList.
4. Scroll down to display the ensureCapacity() method in the Method
Summary. Click ensureCapacity.
5. When the description of the ensureCapacity() method is displayed
(Figure 9-46), select the text by dragging through it. Click Print on the
File menu. When the Print dialog box is displayed, click the Selection
option button and then click the Print button in the Print dialog box to
print the definition.
6. Based on your reading, write a paragraph explaining why you think the
ensureCapacity() method was not used to set or increase the capacity of
the ArrayList object in this chapter.
J ava 2
v 5 . 0
J ava 2
v 5 . 0
description of
ensureCapacity()
method
java.util link
ArrayList link
FIGURE 9-46
 
Search WWH ::




Custom Search