Reason for Wait, Notify and NotifyAll are in Object class Not in Thread Class
The mostly asked interview question for experienced person who have experience Nearly 2-3 years in java. Here are some thoughts on why they should not be in Thread class which make sense to me : 1) W ait and notify is not just normal meth ods or synchronization utility, more than that they are communication mechanism between two threads in Java. And Object class is correct place to make them available for every object if this mechanism is not available via any java keyword like synchronized. Remember synchronized and wait notify are two different area and don’t confuse that they are same or related. Synchronized is to provide mutual exclusion and ensuring thread safety of Java class like race condition while wait and notify are communication mechanism between two thread. 2 )Locks are made available on per Object basis, which is another reason wait and notify is decl...