1.

What’s the difference between notify() and notifyAll()?

Answer»

notify(): It sends a NOTIFICATION and wakes up only a single thread instead of multiple threads that are waiting on the OBJECT’s MONITOR.

notifyAll(): It sends notifications and wakes up all threads and ALLOWS them to compete for the object's monitor instead of a single thread. 



Discussion

No Comment Found