Answer Posted / bindhu
Two threads can communicate with each other using
the wait() and notify() , notifyAl() methods. wait()
method tells the thread to wait until another threads
calls notify() method.
The wait() method causes the current thread to wait
(possibly forever) until another thread notifies it of a
condition change. We use wait() in conjunction with notify
() or notifyAll() to coordinate the activities of multiple
threads using the same resources.
The notifyAll() method notifies all the threads waiting on
the monitor held by the current thread and wakes them up.
Typically, one of the waiting threads will grab the monitor
and proceed.
Is This Answer Correct ? | 57 Yes | 8 No |
Post New Answer View All Answers
What are the purpose of introspection?
Explain the difference between object state and behavior?
What is the difference between the string and stringbuffer classes?
What is the form of storage space in java?
Can you control when passivation occurs?
If your ui seems to freeze periodically, what might be a likely reason?
What are the steps to write p-to-p model application?
Name three subclasses of the component class?
Can you give me a simple example of using the requiredif validator rule?
What are the different types of exception?
How are the elements of a cardlayout organized?
What must a class do to implement an interface?
Why use POJO when I can use hashmap
Can I import same package/class twice? Will the jvm load the package twice at runtime?
Do we need to override service() method