LINKS

Java Tutor Homepage

Java Applications and Components

Java Applets and Components

Java Frequently Asked Questions:
    1. What is Inheritance?
    2. What is Polymorphism?
    3. What is Encapsulation?
    4. Avoiding the Divide by Zero Error
    5. Public Classes in Java Source Files
    6. The Import Statement in Java
    7. Classes with Default Access
    8. What are Local Variables?
    9. What is an Abstract Method?
    10. Data Structures
    11. What is Autoboxing and Auto-Unboxing?
    12. What is multithreading?
    13. What are Threads?
    14. Thread States
    15. What is the Purpose of Synchronization?
    16. Thread Interaction
    17. Can You Start a Thread Twice?

Java FAQ 14 - Thread States

There are five states that a thread can be in:

1. New: This is the thread state once the Thread instance has been created, he thread is not yet being executed. The start() method has not yet been called.

2. Runnable: The thread could now run, however, the scheduler has not yet selected it to run. Once the start() method is called this is the state of the thread.

3. Running: The state of the thread when the scheduler has selected it to run.

4. Waiting/blocked/sleeping: the thread is not eligible at this time to run, it can be in the future though.

5. Dead: Once the thread’s run() method has been completed, the thread is dead, it can never be brought back to life.