Explain the purposes of methods wait(), notify(), notifyAll
()?

Answer Posted / tek

All the three methods are called in synchronized block or
method.

wait(): Thread calling wait method will go to the waiting
state and it will loose its monitor. It will execute only
if it is notified by the other threads.

notify(): To notify thread which is waiting for the concern
object.

notifyAll(): To notify all the threads which are in waiting
state.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do I get a duplicate name error when loading a jar file?

648


What is the relationship between local interfaces and container-managed relationships?

701


Explain the difference between object state and behavior?

653


What is synchronization and why is it important?

617


How to pass parameters in RMI?

1821






What is the map interface?

710


What are the different types of exception?

672


Which container method is used to cause a container to be laid out and redisplayed?

748


What is the difference between session and entity beans?

669


How to determine SGA site?

2016


Is jvm a overhead?

704


What is table mutation and how do you avoid it?

2005


What are local interfaces? Describe.

781


Name the class that is used to bind the server object with RMI Registry?

1782


Explain RMI Architecture?

705