How can two threads be made to communicate with each other?
Answer Posted / @dania@
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
Is This Answer Correct ? | 18 Yes | 0 No |
Post New Answer View All Answers
What are meta-annotations?
Explain different ways of creating a thread. Which one would you prefer and why?
What is the use of volatile in java?
What is the locale class in java programming?
Why string objects are immutable in java?
What is variable declaration and definition?
Objects or references which of them gets garbage collected?
What is jagged array in java?
What about method local inner classes or local inner classes in java?
How do you compare two strings lexicographically?
How do you escape json?
What are the differences between abstract class and interface?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
what is meant by HQL?
What is this () in java?