What is the result of trying to compile and run this program?
D is correct. 1 and 2 will be printed, but there will be no return from the wait call because no other thread will notify the main thread, so 3 will never be printed. It's frozen at line 7.
it works as stated. Prints 1,2 and stops forever.... (because nobody notified it!)
now,, i tried replacing wait() with wait(1000)....
this prints 1 2 (pause) 3....
Does this mean that the overloaded wait with one argument goes directly to runnable state after waiting for 1000 millisecs?
Does it not wait for someone to notify(), after the specified arg time is over?