What are the methods used for inter-thread communication?
and in what class these methods are defined?

Answer Posted / ranganathkini

The methods used for inter-thread communication are:

1. wait() - causes thread to wait until another thread calls
the notify() or notifyAll() methods.
2. notify() - wakes up any thread waiting on this object
notifyAll() - wakes up all threads waiting on this object

These methods are a part of the java.lang.Object class.

Is This Answer Correct ?    17 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ripple effect?

640


How many times may an objects finalize() method be invoked by the garbage collector?

680


What is the diffrence between a local-tx-datasource and a xa-datasource?

582


What is the difference between RMI and Corba?

2269


Do we need to override service() method

1147






What is the relationship between the canvas class and the graphics class?

550


What class is the top of the awt event hierarchy?

586


Can I import same package/class twice? Will the jvm load the package twice at runtime?

651


How to pass parameters in RMI?

1695


What is in-memory replication?

562


How can I scroll through list of pages like the search results in google?

573


When a thread blocks on i/o?

573


Can constructors be synchronized in java?

625


what are memory considerations of jsp compares to other web components?

6020


What is jboss?

578