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
Can I import same package/class twice? Will the jvm load the package twice at runtime?
What is meant by method chaining?
Difference between DurableSubscription and non- DurableSubscription?
What is mdb and what is the special feature of that?
whats is mean by connectionpooling
When a thread blocks on i/o, what state does it enter?
what are the activation groupworks?
Do you think that java should have had pointers?
What state does a thread enter when it terminates its processing?
Explain the steps in details to load the server object dynamically?
How can I scroll through list of pages like the search results in google?
How is a java object message delivered to a non-java client?
What are the steps to write p-to-p model application?
What is a modular application?
What is the difference between RMI registry and OS Agent?