Minggu, 08 November 2020

Difference between notify and notifyAll in Java - When and How to use

notify vs notifyAll in Java
What is the difference between notify and notifyAll method is one of the tricky Java questions, which is easy to answer but once the Interviewer asks follow-up questions, you either got confused or not able to provide clear-cut and to the point answers? The main difference between notify and notifyAll is that the notify method will only notify one Thread and the notifyAll method will notify all Threads which are waiting on that monitor or lock. By the way, this is something you have been reading all over places and to be frank,  this statement despite being correct is not complete, and it's very difficult to understand the difference between notify vs notifyAll by just reading this statement.

Lorem ipsum is simply dummy text of the printing and typesetting industry.

Comments


EmoticonEmoticon