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

When a thread blocks on i/o?

792


What is abstract schema?

771


What are callback interfaces?

820


Why does the tag url-encode javascript and mailto links?

800


Difference between hashmap and hashtable?

843


Can you control when passivation occurs?

811


Whats new with the stop(), suspend() and resume() methods in jdk 1.2?

801


What if the static modifier is removed from the signature of the main method?

968


What’s jboss jbpm?

762


Why use a datasource when you can directly specify a connection details? (in a J2EE application)

3852


What is a modular application? What does module-relative mean?

761


Difference between swing and awt?

845


Why is string immutable in java?

820


What is message driven beam?

797


What are the different approaches to represent an inheritance hierarchy?

825