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 the relationship between local interfaces and container-managed relationships?
What is a modular application? What does module-relative mean?
Can I use javascript to submit a form?
What is bean? Where can it be used?
What is the purpose of the wait(), notify(), and notifyall() methods?
What is the difference between RMI and Corba?
how to make a index.jsp for running the site in internet and find an error for connection with weblogic server and java that give an error invalid object name.and how to maintain session.
what are RemoteObjects?
How database connectivity in XML is achieved?
What are the different methods of identifying an object?
What are transaction attributes?
What is Stream Tokenizer?
int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!
Explain how will the struts know which action class to call when you submit a form?
what are memory considerations of jsp compares to other web components?