What is the use of having timeout argument for the wait() method?
If i understand correctly, both when the
(1)thread is notifiied and when the
(2)time in the wait method expires,
the thread goes to Blocked-for-lock acquisition state.And when the lock on the object is released it goes to ready-to-run state and then to running state whenever it gets chance.
So the call to wait() method returns at the same time in both cases.
And also when the thread is interrupted, does the thread go to Blocked-for-lock acquisition state-->>Ready State-->>Running annd then throws the InterruptedException.Please correct me if i am wrong.