Multiple choice

Find out the true statements.

i. HashMap is synchronized. ii. HashMap is non-synchronized. iii. Hashtable is non-synchronized. iv. Hashtable is synchronized.

  1. i. and iii. are true.

  2. i. and iv. are true.

  3. ii. and iii. are true

  4. ii. and iv. are true.

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

This answer is correct. HashMap is not thread-safe or synchronized. In other words, HashMap is non-synchronized. So, the key value pair is not thread-safe. Hashtable is thread-safe or synchronized.The key value pair will not be affected by different threads.