I just wanted to get verification.When Thread.sleep is called - does it pass execution to otherthreads? or does it hold executionMeaning, when a thread is sleeping, are other threads executing? Ordoes the thread hold execution for its 'share'
If the other thread is called before the sleep method then the otherthread will continue processing. But if you havesleep(x);methody();then methody() will be called after the sleeping has finished.
Yes, it passes execution to other threads..........
This question is not entirely meaningful.Java threads are always pre-emptive.Even if the thread didn't pass execution,other threads would still be executingand get their share of the CPU - so you don'thave to worry about it.