Main reason for calling wait and notify method from either synchronized block or method is that it made mandatory by Java API. If you don't call them from synchronized context, your code will throw IllegalMonitorStateException. A more subtle reason is to avoid race condition between wait and notify calls.
-
Previous Java ProgrammingWhy you should check condition for waiting in a loop?
-
Next On Java ProgrammingDifference between interrupted and isInterrupted method in Java?
No Comment to " Why wait and notify method are called from synchronized block? "