the basic difference betwwen sleep and wait is that sleep takes the lock when it sleeps. so other thread which also wants to enter the same synchronized method on the same object couldnot enter. but wait release the lock . so other thread which wants to enter the same synchronized method on the same objectcould do so.
These links are quite helpful. Knowing only the difference between sleep and wait did not really help when it comes to programs and their output. I get really confused what exactly be the out put and sometimes the output is undetermined.
thank you guys for putting your effort again!
Whatever. Here's a tiny ad:
SKIP - a book about connecting industrious people with elderly land owners