Multiple choice technology programming languages

Which is the most suitable Java collection class for storing various companies and their stock prices? It is required that the class should support synchronization inherently.

  1. Hashtable

  2. Hashmap

  3. Linked Hashmap

  4. Hashset

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Hashtable is the only inherently synchronized option among these classes, making it thread-safe for concurrent access. HashMap and its variant LinkedHashMap are not synchronized by design, while HashSet cannot store key-value pairs. Hashtable's built-in synchronization makes it suitable for multi-threaded environments without requiring additional synchronization code.