What is difference between wait and notify in java?



What is difference between wait and notify in java?..

Answer / Aditya Kumar

In Java, `wait()` and `notify()` are methods used for synchronization in multi-threading. The `wait()` method makes the current thread wait until it is notified by another thread. The `notify()` method wakes up one of the threads that are waiting on an object. `notifyAll()` wakes up all threads that are waiting.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What happens if constructor is private?

1 Answers  


Why char array is favored over string for the storage of passwords?

1 Answers  


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

1 Answers   Amazon,


Can constructor be protected in java?

1 Answers  


java Api provided try catch finally ,try catch(its ok) but why try finally and exception occured at try then how the flow is?

1 Answers   Naaptol,


What is the default value of local and global variables?

1 Answers  


what is Thread?

6 Answers  


How can I become a good programmer?

1 Answers  


What is application system?

1 Answers  


List some java keywords sun like c, c + + keywords?

1 Answers  


Why chararray() is preferred over string to store the password?

1 Answers  


how to open and edit XML file in Weblogic???

1 Answers   Symphony,


Categories