Runnable
: interface whose implementing class instance is run by a thread
sleep()
: causes currently executing thread to sleep
InterruptedException
: used to catch exceptions which may arise when interrupting a running thread
currentThread()
: returns a reference to the currently running thread
class ThreadTest2 implements Runnable{
SimpleThread t1= new SimpleThread("Thread 1")
Thread.currentThread().sleep(1000)
catch (InterruptedException e)