Java Multi-Threading Question: Download Questions PDF
What the difference is between notify and notify All methods?
![Java Multi-Threading Interview Answer Java Multi-Threading Interview Question](https://globalguideline.com/public/images/interview/33.png)
Answer:
The notify will run only first thread which has called wait() on same object. i.e. the object which has called the wait() must be the same as the object that calls
The notifyAll will run all threads which has called wait() on same object.
While using notifyAll the highest priority thread will run first.
The notifyAll will run all threads which has called wait() on same object.
While using notifyAll the highest priority thread will run first.
Download Java Multi-Threading Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain some ways in which a thread can enter the waiting state? | Explain the difference between yielding and sleeping? |