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.
Choices:
• A. Hashtable
• B. HashMap
• C. LinkedHashMap
• D. HashSet
• E. TreeMap
• A
Explanation:
To store the company names and their corresponding stock prices, a Map implementation
would be appropriate because it stores key-value pairs. HashSet is not the correct answer
because it does not implement the Map interface. Hashtable, HashMap, TreeMap, and
LinkedHashMap are the classes that implement the Map interface. Among these, only the
Hashtable class is inherently synchronized.