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 |
why an outer class cannot be declared as private?
What is the reason behind using constructors and destructors?
What is remote method invocation (rmi)?
How many bits are in a sentence?
Explain all java features with real time examples
What are byte codes?
How many types of operators are there?
What is a constructor, constructor overloading in java?
What is the difference between throw and throws? What is the similarity between try and throw?
What is internal iteration in java se 8?
Is java hashset ordered?
Differentiate between a constructor and a method? Can we mark constructors final?