Explain the purposes of methods wait(), notify(), notifyAll
()?
Answer Posted / tek
All the three methods are called in synchronized block or
method.
wait(): Thread calling wait method will go to the waiting
state and it will loose its monitor. It will execute only
if it is notified by the other threads.
notify(): To notify thread which is waiting for the concern
object.
notifyAll(): To notify all the threads which are in waiting
state.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are local interfaces? Describe.
how do you Handle Front End Application data against DB with example?
What does module-relative mean?
Is jvm a overhead?
What is the difference between RMI and Corba?
Explain the advantages and disadvantages of detached objects.
What is the purpose of the notify() method?
What is threadfactory?
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.
Name three component subclasses that support painting?
What is difference between object state and behavior?
What is Remote Server?
Why are some of the class and element names counter-intuitive?
Can I use multiple html form elements with the same name?
What is a class loader? What are the different class loaders used by jvm?