Explain the purposes of methods wait(), notify(), notifyAll
()?
Answer Posted / sumitpalsingh
The purpose of using the wait(),notify() and notifyAll() methd is used for interThread communication.
for Example :-There is a n situation communication between Producer and Consumer...Producer wll produce an item and go to waiting state by using wait() method.and it will notify to the consumer for to consume an item. After conume an Item Consumer will come into waiting state by using wait() method ..and give the notification to Produer by using notify() method to produce an item.But all these methods are called only in synhronized() method or synchronized block.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
which type of objects reference will be given to client?
How substring() method of string class create memory leaks?
Define aop(assepct oriented programing)?
Is it possible to stop the execution of a method before completion in a sessionbean?
If your ui seems to freeze periodically, what might be a likely reason?
Describe, in general, how java's garbage collector works?
What is the difference between a static and a non-static inner class?
Write a program to show synchronization?
Is “abc” a primitive value?
what are getters and setters in Java with examples?
What method is invoked to cause an object to begin executing as a separate thread?
In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?
Why are my checkboxes not being set from on to off?
What is table mutation and how do you avoid it?
Where can I ask questions and make suggestions about seam?