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 are different types of expressions?
Which are different kinds of source code?
What is the purpose of a transient variable?
What is a file pointer?
Define interface in java?
What is collections framework?
How are the elements of a gridbaglayout organized?
What does the append?
Convert Binary tree to linked list.
What are the fileinputstream and fileoutputstream?
How many threads can I run java?
How many digits can a float hold?
How do you initialize an arraylist in java?
how to create multithreaded program? Explain different ways of using thread? : Java thread
What is use of static in java?