Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Why wait, notify and notifyAll is defined in Object Class and not on Thread class in Java?

Why Wait, Notify And NotifyAll Is Defined In Object Class And Not On Thread Class In Java?
Why wait, Notify and notifyAll is declared in Object Class instead of Thread is a famous core Java interview question which is asked during all levels of Java interview ranging from 2 years, 4years to quite senior level position on java development. The beauty of this question is that it reflects what does interviewee knows about the wait notify mechanism, how does it sees the whole wait and notify feature, and whether his understanding is not shallow on this topic. Like Why Multiple inheritances is not supported in Java or why String is final in java there could be multiple answers of why wait and notify is defined in Object class and everyone could justify their reason.  


This post first appeared on Javarevisited: Blog About Java Programmin, please read the originial post: here

Share the post

Why wait, notify and notifyAll is defined in Object Class and not on Thread class in Java?

×

Subscribe to Javarevisited: Blog About Java Programmin

Get updates delivered right to your inbox!

Thank you for your subscription

×