Java Reference
In-Depth Information
There is lots of code in this chapter. Test code is in the root directory, non-
standard protocols are in package
weiss.nonstandard
, and everything else is in
package
weiss.util
.
Collection.java
Contains the code in Figure 6.9.
Iterator.java
Contains the code in Figure 6.10.
Collections.java
Contains the code in Figures 6.13 and 6.14.
Arrays.java
Contains the code in Figure 6.15.
List.java
Contains the code in Figure 6.16.
ListIterator.java
Contains the code in Figure 6.17.
TestArrayList.java
Illustrates the
ArrayList
, as in Figure 6.18.
Set.java
Contains the code in Figure 6.29. The online code
contains an extra method that is not part of Java 5.
Stack.java
Contains the nonstandard protocol in Figure 6.26.
UnderflowException.java
Contains a nonstandard exception.
Queue.java
Contains the standard interface in Figure 6.28.
SortedSet.java
Contains the code in Figure 6.30.
TreeSetDemo.java
Contains the code in Figures 6.11 and 6.31.
IteratorTest.java
Contains the code that illustrates all the iterators,
including code in Figures 6.11, 6.32, and 6.35.
EqualsWithInheritance.java
Contains the code in Figures 6.33 and 6.34, com-
bined as one.
Map.java
Contains the code in Figures 6.36 and 6.37.
MapDemo.java
Contains the code in Figure 6.38.
DuplicateFinder.java
Contains the code in Figure 6.39.
PriorityQueueDemo.java
Contains the code in Figure 6.41.
IN SHORT
6.1
Show the results of the following sequence:
add(4)
,
add(8)
,
add(1)
,
add(6)
,
remove()
, and
remove()
when the
add
and
remove
operations
correspond to the basic operations in the following:
a.
Stack
b.
Queue
c.
Priority queue
Search WWH ::
Custom Search