Java Reference
In-Depth Information
CHAPTER
21
S ETS AND M APS
Objectives
To store unordered, nonduplicate elements using a set (§21.2).
To explore how and when to use HashSet (§21.2.1), LinkedHashSet
(§21.2.2), or TreeSet (§21.2.3) to store a set of elements.
To compare the performance of sets and lists (§21.3).
To use sets to develop a program that counts the keywords in a Java
source file (§21.4).
To tell the differences between Collection and Map and describe
when and how to use HashMap , LinkedHashMap , or TreeMap to
store values associated with keys (§21.5).
To use maps to develop a program that counts the occurrence of the
words in a text (§21.6).
To obtain singleton sets, lists, and maps, and unmodifiable sets, lists,
and maps, using the static methods in the Collections class (§21.7).
 
 
 
Search WWH ::




Custom Search