Google News
logo
Java Multithreading - Interview Questions
What are the different thread states?
New : When a thread is created either by extending Thread class or implementing Runnable interface it is in "New State".
Runnable : When we call start() method on the thread object that causes the thread to begin execution and it's the Java Virtual Machine that calls the run method of the thread.
Blocked : When a resource is shared among various threads then a thread may go into blocked state as the resource may be used by another thread.
Waiting : A thread that is waiting indefinitely for another thread to perform a particular action is in the waiting state.
Timed_Waiting : A thread that is waiting for another thread to perform an action for up to a specified waiting time is in timed_waiting state.
Advertisement