With respect, we do NOT need to get reference to the current thread. That reference is meaningless because sleep is a static method, and it always sleeps the current thread only. sleep() can never affect any thread other than the current thread. We don't need reference to an instance of a class to invoke a static method of the class.
Originally posted by Sudhakar Veluru: Can I use sleep method in my application without using threads. is there any System.sleep() kind of thing??
The basic concept of java is a thread is always running in your application program.So sleep without threads is meaningless.Sleep means to sleep a thread.And when u say Thread.sleep() in main() it is the main thread u are commanding to sleep.