Which of the following is synchronized?

  • ArrayList
  • Hashtable
  • LinkedList
  • StringBuilder
The Hashtable class in Java is synchronized, which means it is thread-safe. This ensures that multiple threads can safely access and modify the Hashtable concurrently without causing data corruption. ArrayList and LinkedList are not synchronized, making them suitable for single-threaded operations by default. StringBuilder is also not synchronized and is used for efficient string manipulation in a single thread.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *