What is difference between creating a thread by extending Thread class and implementing Runnable?
Explain the four different states of a thread The four different states of a thread are new: When a thread is created with new operator .It is not yet running. Runnable: Once you invoke the start method on the thread it becomes runnable. It is up to the OS to decide when to give time to the thread to run. A runnable thread may or may not be running. Blocked : Thread enters this state under the following condition. Someone calls sleep () on the thread. Thread calls an operation that blocks on input/output. Thread calls wait() method. Thread tries to lock an object that is currently locked by another thread. Dead : The Thread is dead for one of two reasons. It dies a natural death because the run method exits normally. It dies abruptly because an uncaught exception terminates the run method.