Objects and Collections - Programming

Q1:

Which collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?

A java.util.SortedMap

B java.util.TreeMap

C java.util.TreeSet

D java.util.Hashtable

ANS:D - java.util.Hashtable

Hashtable is the only class listed that provides synchronized methods. If you need synchronization great; otherwise, use HashMap, it's faster.