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


Please Help Members By Posting Answers For Below Questions

Can list contain null in java?

625


What is ternary operator?

564


Where local and global variables are stored?

541


Which is better singleton or static class?

503


What is java beans?

570






What kind of variables a class can consist of?

630


What is the difference between checked exception and unchecked exception?

525


What happens when a thrown exception is not handled?

579


Does apple use java?

491


What do you mean by scope of variable?

479


Is cout buffered?

683


What is t in parametric equations?

541


Why arraylist is used in java?

547


What do you mean by garbage collection used in java?

569


What is the use of conditional statement?

562