Explain wait(), notify() and notifyall() methods of object class ?



Explain wait(), notify() and notifyall() methods of object class ?..

Answer / Priyanka Prajapati

In Java, the 'wait()', 'notify()', and 'notifyAll()' methods are used for inter-thread communication. An object's monitor (synchronization lock) is associated with these methods to control access to critical sections of code. The 'wait()' method causes the current thread to wait until it is notified by another thread, while 'notify()' and 'notifyAll()' allow other waiting threads to resume execution.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

in a console we r giving java <class name> if r pressing enter where it'll goes

2 Answers   CSC,


what is the form of storage space in java?

5 Answers  


5 What is Java exception handling?

1 Answers  


What is stack explain?

1 Answers  


How many types of the indexof method are there for strings?

1 Answers  


Why is boolean important?

1 Answers  


Explain about the performance aspects of core java?

1 Answers  


what is the main class of all the classes

5 Answers   Photon,


In method overloading ,if i change the return type to Long instead of INT,is the program execute

6 Answers   HCL,


What is the difference in between cpp and java? Can u explain in detail?

1 Answers  


solve (x-1)(x-9)=8;

3 Answers   IBM, Manhattan, TCS,


what is difference between abstract factory and factory design patterns?

0 Answers  


Categories