1.

Which of these method wakes up all the threads?(a) wakeAll()(b) notify()(c) start()(d) notifyAll()This question was addressed to me at a job interview.My doubt is from Creating Threads topic in division Multithreading of Java

Answer»

Correct answer is (d) notifyAll()

Easy explanation: notifyAll() wakes up all the THREADS that called wait() on the same object. The HIGHEST priority THREAD will RUN first.



Discussion

No Comment Found

Related InterviewSolutions