Quiz: Java Concurrency Questions
Browse questions from Quiz: Java Concurrency. Each question has options and an explanation.
Questions — Page 1 of 2
- Why is implementing Runnable often more flexible than extending Thread?
- A class that extends Thread cannot extend another concrete class.
- What does volatile primarily guarantee?
- volatile alone makes count++ atomic.
- Which tool is appropriate for lock-free integer counters?
- Atomic classes can help make simple shared updates thread-safe.
- Which collection is designed for many reads and rare writes by copying on modification?
- A normal ArrayList is automatically safe for concurrent writes from many threads.
- A shared boolean stop flag is updated by one thread and read by another. Which keyword is usually enough for visibility?
- Why did a HashMap frequency counter fail when multiple threads updated it at the same time?