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.  

تعليقات

المشاركات الشائعة من هذه المدونة

Why use Underscore in Numbers from Java? Underscore in Numeric Literals Example

3 ways to convert String to Boolean in Java? Examples

Coursera's TensorFlow: Advanced Techniques Specialization Review [2022]