Multiple choice technology programming languages

Which of the following collection classes from java.util package are Thread safe?

  1. Vector

  2. HashMap

  3. ArrayList

  4. Hashtable

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

In java.util, Vector and Hashtable are legacy classes (from Java 1.0/1.1) that are synchronized and therefore thread-safe. Modern classes like ArrayList and HashMap (added in Java 1.2) are not thread-safe for performance. ConcurrentHashMap would be a modern thread-safe alternative. Options A and D are correct.