Question 10
a. Each element must be unique.
b. Duplicate elements must not replace old elements.
c. Elements are not key/value pairs.
d. Accessing an element is almost as fast as performing the same operation on an array.
Which of these classes provides the specified features?
a. LinkedList
b. TreeMap
c. TreeSet
d. HashMap
e. HashSet
f. LinkedHashMap
g. LinkedHashSet
h. Hashtable
i. None of the above
answer: (e) HashSet
i wonder why (g) LinkedHashSet isn't correct answer...
according to TIJ 3rd ed., "traversal is cheaper with LinkedHashSet (than HashSet) because of the linked list", so LinkedHashSet fulfills all 4 requirements, or not?