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 container method is used to cause a container to be laid out and redisplayed?
Have you used threads in Servelet?
why static class in java
What is the difference between the ‘font’ and ‘fontmetrics’ class?
To identify IDL language what mapping mechanism is used?
What are transaction attributes?
What is the purpose of the notify() method?
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??
What are the different class loaders used by jvm?
What are the call back methods in entity bean?
How would you create a button with rounded edges?
What are the steps to write p-to-p model application?
What do you mean by Socket Programming?
What is in-memory replication?
What is RMI and what are the services in RMI?