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
Explain OOPs concept.
Why should we use singleton pattern instead of static class?
what is interface in java? Explain
What does file separator do in java?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
What is the difference between length and size in java?
Explain the difference between intermediate and terminal operations in java8?
Is there any difference between synchronized methods and synchronized statements?
What is the use of generics? When was it added to the Java development Kit?
What is string :: npos?
In how many ways we can do exception handling in java?
What is nan inf?
Whats the difference between notify() and notifyall()?
State one difference between a template class and class template.
What is connection class in java?