Uncategorized

Why wait (), notify () and notifyAll () must be called from synchronized block or method in Java

http://javarevisited.blogspot.com/2011/05/wait-notify-and-notifyall-in-java.html One of the best article available in internet about wait()notify() and notifyAll() methods in java. these method forms the inter-thread communication and correct understanding of these methods are must. wait() and notify)() method has to be called from synchronized method or block but why ?? this is what this article discusses as an interview experience. This same question was asked to my friend during an interview and if he would have read this post before it would be quite beneficial for him
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s