Multiple choice technology programming languages

• Stores key/value pairs. • Duplicate entries replace old entries. • Provides constant-time performance for the add, contains and remove operations. Which of these classes provides the specified features?

  1. LinkedHashMap

  2. LinkedHashSet

  3. TreeSet

  4. HashMap

  5. HashSet

  6. Hashtable

Reveal answer Fill a bubble to check yourself
A,D,F Correct answer
Explanation

The question asks for classes that store key/value pairs, replace old entries on duplicates, and offer constant-time performance. LinkedHashMap, HashMap, and Hashtable implement the Map interface (storing key/value pairs) and provide constant-time performance. LinkedHashSet, TreeSet, and HashSet are Set implementations, not Maps.