Java Reference
In-Depth Information
CHAPTER
20
L ISTS ,S TACKS ,
Q UEUES , AND
P RIORITY  Q UEUES
Objectives
To explore the relationship between interfaces and classes in the Java
Collections Framework hierarchy (§20.2).
To use the common methods defined in the Collection interface for
operating collections (§20.2).
To use the Iterator interface to traverse the elements in a collection
(§20.3).
To use a foreach loop to traverse the elements in a collection (§20.3).
To explore how and when to use ArrayList or LinkedList to store
a list of elements (§20.4).
To compare elements using the Comparable interface and the
Comparator interface (§20.5).
To use the static utility methods in the Collections class for sorting,
searching, shuffling lists, and finding the largest and smallest element
in collections (§20.6).
To develop a multiple bouncing balls application using ArrayList
(§20.7).
To distinguish between Vector and ArrayList and to use the Stack
class for creating stacks (§20.8).
To explore the relationships among Collection , Queue ,
LinkedList , and PriorityQueue and to create priority queues
using the PriorityQueue class (§20.9).
To use stacks to write a program to evaluate expressions (§20.10).
 
 
 
Search WWH ::




Custom Search