Wat's the difference between sleep() of thread class and wait() of Object.
first of all wait() must be called within a synchronized block, sleep() not. with wait() the object is putted into the wait-pool monitor and must wait for a notify() or notifyAll() to get a change for running again. sleep() goes into a non-runnable state after the method sleep() is called a turn back into the state runnable at earlies when the given milliseconds are elapsed.
Originally Posted by parimalakr