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.
Loading...
Related Quiz
- What is the impact of declaring a constructor private in a class?
- Which of the following classes is mainly used to establish a connection to the database in JDBC?
- Which access modifier allows a member to be accessed from within its own class only?
- Which of the following is true regarding the flow of control in a try-catch-finally statement?
- The ________ keyword is used to declare objects that cannot change.