← All topics
Quiz: Java Multithreading: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which method starts a new thread of execution?
- Q2. What do all threads of a process share?
- Q3. Why can count++ give wrong results with two threads?
- Q4. What does join() do?
- Q5. Which is a thread-safe Map for heavy concurrent use?
- Q6. What does this print? (code)
- Q7. Which of these releases the lock the thread is holding while it waits?
- Q8. What does marking a field volatile guarantee?
- Q9. Which rule prevents the classic two-lock deadlock?
- Q10. What does this print? (code)