I'm quite confused regarding how wait()
method in threads work. Suppose I write:
public class test3 {
public static void main(String args[]){
Thread A = new Thread();
synchronized(this){
A.wait();
}
}
}
Now here method wait()
will be called by which thread - Main thread or Thread A, in other sense, which thread will leave the monitor and temporarily go to sleep.