sleep() is a static method of class Thread. How does it work when called from multiple threads. and how does it figure out the current thread of execution. ?
or may
how does it figure out the current thread of execution?
It doesn't have to. It just calls the operating system, which always sleeps the thread that called it.