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 the difference between runnable and callable interface in java?
Garbage collection in java?
Is map sorted in java?
What are methods and how are they defined?
Explain about join() method?
If we don’t want some of the fields not to serialize how to do that?
what is ststic with example
How many inner classes can a class have?
What is difference between printf and scanf?
What is anonymous inner class?
Explain aggregation in java?
Is 0 an irrational number?
What is a type parameter in java?
Why Java doesn’t support multiple inheritance?
if u open login & logout ,how can udisplay the timelogin & logout members ?