How two different class threads communicate with each
other?. send example code.
Answer Posted / puneet khanna
The threads in java follow Mutual exclusion( synchronized)
and co-operation;
for co-operation they need to talk to each other by messages
saying " i am waiting in the wait q anyone can acquire the
lock of the object" or" i have acquired the lock now by
notify() to the last thread who called wait() or by
notifyall() to all the threads who are in the wait q"
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is a condition in programming?
What is advantage of java?
What is the replace tool?
Why is a constant variable important?
Explain the difference between an object-oriented programming language and object-based programming language?
How do you use equal in java?
How do you break a loop?
When will you define a method as static in Java?
What is the base class for error and exception?
What is anagram number?
What does sprintf return?
what is a green thread? : Java thread
Explain yield() method in thread class ?
What is java thread dump, how can we get java thread dump of a program?
What about member inner classes?