Two ways exist to determine whether a thread has finished. First, you can call isAlive()
on the thread. This method is defined by Thread
, and its general form is shown here:
final boolean isAlive()
The isAlive()
method returns true if the thread upon which it is called is still running. It returns false otherwise. While isAlive()
is occasionally useful, the method that you will more commonly use to wait for a thread to finish is called join()
isAlive()
vs join()
. Advantages?