top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Why wait and notify method should be called in loop in Java?

+2 votes
616 views
Why wait and notify method should be called in loop in Java?
posted Mar 25, 2014 by Pushpak Chauhan

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

+1 vote

It is not mandatory to call wait and notify in a loop, it can be called in different synchronized method.

answer Mar 25, 2014 by Amit Kumar
0 votes

to prevent doing task, if condition is not true and thread is awake due to false alarms, checking conditions in loop ensures that processing is only done when business logic allows.

answer Mar 26, 2014 by Ashwini Miraj
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...