Hi,
In this case if I create two instances of ThreadTest and call the method start().
The output of this code was :
My question is if the first
thread calls goToWait() method then it goes to wait state i.e call to wait method does not return.
As the method is synchronised it allows only one thread to call goToWait() method. So concept wise when the first thread is in the wait mode at(// 1) then it should not allow any other thread to enter goToWait() method.
But in this case we see both the threads are in wait state. I think only one thread should be in wait state.
Could any one explain why such behaviour.
Regards
Atul