Java Reference
In-Depth Information
The static method
currentThread()
always refers to the current thread at what-
ever point it is called. Each thread has a name assigned by the VM, but that
name can be overridden programmatically.
The
sleep()
method causes a thread to stop running and yields control to other
threads that might be able to execute.
The
sleep()
method can throw an
InterruptedException
, so code that includes
it must be wrapped in a
try...catch
block.