Java Reference
In-Depth Information
7. The output produced by the program is shown here:
8. On your own, try modifying Queue so that it stores other types of objects. For ex-
ample, have it store int s or double s.
The For-Each Style for Loop
When working with arrays, it is common to encounter situations in which each element in
an array must be examined, from start to finish. For example, to compute the sum of the
values held in an array, each element in the array must be examined. The same situation
occurs when computing an average, searching for a value, copying an array, and so on. Be-
Search WWH ::




Custom Search