Thread isAlive() and join() Methods in Java

Here we will discuss the Thread isalive() and join() method in java

There are two ways to determine whether a thread has finished or not.

  • isAlive()
  •   join()

Read More: Thread Concepts

Thread Life Cycle in Java
Multithreading in Java Thread Creation Method Use Example
Thread Priorities in Java
Main Thread in Java
Thread Yield method in Java
Thread Synchronization in Java
Thread suspend() and resume() method in Java

Thread isAlive() Method

The isAlive() method is used to check whether a thread is in the running or not.

                                                or

In other words, this method determines thread is live or dead. 

isAlive( )method returns true if the thread is still running otherwise it returns false.

Thread join() Method

This method waits for the specified thread to terminate.

Result