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
what is handle?
What are JTA/JTS and how they used by client?
To what value is a variable of the string type automatically initialized?
What are the oops concept?
Explain about local interfaces.
when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??
If your ui seems to freeze periodically, what might be a likely reason?
What restrictions are placed on the location of a package statement within a source code file?
how do you Handle Front End Application data against DB with example?
What is the difference between the string and stringbuffer classes?
Which class is the immediate superclass of the menucomponent class?
Difference between loadclass and class.forname?
How to implement RMI in Java?
What is a modular application?
What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?