I have a confusion with wait() method of thread class. It is known that wait() method is called from a synchronized context always. But after execution of wait method, will that thread release the lock on that object which it was holding.
I mean to ask that “When a thread goes to wait pool of an object, before going will it release the lock it has.”
yes. Its pretty clearly stated in the javadoc:
wait
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html#wait()
public final void wait()
throws InterruptedException