why are wait(), notify() and notifyall() methods defined in the object class? : Java thread



why are wait(), notify() and notifyall() methods defined in the object class? : Java thread..

Answer / Amit Tripathi

The wait(), notify(), and notifyAll() methods are defined in the Object class because they provide a general mechanism for one thread to signal other threads waiting on an object. These methods allow for synchronization between multiple threads accessing shared objects.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Explain where variables are created in memory?

1 Answers  


What is a jagged array in java?

1 Answers  


Is it possible to write method inside method

4 Answers   L&T,


What is remote method invocation (rmi)?

1 Answers  


What is the need of transient variables in Java ?

1 Answers   MCN Solutions,


Can we use both this () and super () in a constructor?

1 Answers  


What are thread safe functions?

1 Answers  


what is webservices

5 Answers   Consultancy, Mind Tree,


What are the major drawbacks of external iteration?

1 Answers  


what are Hostile Applets?

1 Answers  


What do you mean by order of precedence and associativity?

1 Answers  


What is bubble sort in java?

1 Answers  


Categories