Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Java Programming Language Interviews:Advanced JavaCore JavaEclipseFull Stack Developer (Java)HibernateIBM WebSphereInternationalization LocalizationJ2EEJ2MEJ2SEJavaJava ANTJava AppletJava BeansJava ClassesJava EJB ProgrammingJava Game DeveloperJava GUI FrameworkJava JNDIJava JNIJava JSP ProgrammingJava Message Service (JMS)Java Multi-ThreadingJava Networking - Sockets and RMIJava PatternsJava SecurityJava Server FacesJava Servlet ProgrammingJava Software EngineerJava Swing ProgrammingJava TechnicalJava ThreadsJava Transaction APIJava Web ServicesJavaMailJBossJDBCJMSJSFPortal and PortletRMISpring FrameworkSr.Java Web DeveloperStrutsSunOneSwing AWTSWT JFace
Copyright © 2018. All Rights Reserved
Java Multi-Threading Interview Question:
What are the different states of a threads lifecycle?
Submitted by: AdministratorFollowing are the different states of threads:
1. New - A thread is called in New state until the start() method is called for the object of that thread. The thread is not alive in this state.
2. Runnable - The thread is called in Runnable state after the start() method is called for the object of that thread. The thread may enter into the Runnable state from Running state. The thread is called alive in this state.
3. Running - The thread is called in Running state when the thread scheduler take it from the Runnable thread's pool.
4. Waiting/Blocked/Sleeping - In these states the thread is alive but it's not in Runnable state. A running thread is called in these states after wait() or sleep() method is called that thread or when the thread is blocked while waiting for I/O resources.
5. Dead - After the execution of run() method is complete then the thread is called in dead state. Once a thread is dead then it cannot be start again.
Submitted by: Administrator
1. New - A thread is called in New state until the start() method is called for the object of that thread. The thread is not alive in this state.
2. Runnable - The thread is called in Runnable state after the start() method is called for the object of that thread. The thread may enter into the Runnable state from Running state. The thread is called alive in this state.
3. Running - The thread is called in Running state when the thread scheduler take it from the Runnable thread's pool.
4. Waiting/Blocked/Sleeping - In these states the thread is alive but it's not in Runnable state. A running thread is called in these states after wait() or sleep() method is called that thread or when the thread is blocked while waiting for I/O resources.
5. Dead - After the execution of run() method is complete then the thread is called in dead state. Once a thread is dead then it cannot be start again.
Submitted by: Administrator
Copyright 2007-2025 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.