Jumat, 03 Maret 2017

What are the methods of the Thread Class

isAlive() and join() Methods Even though threads are independent most of the time, there might some instance at which we want a certain thread to wait until all other thread complete their execution. In such situation we can use isAlive() and join() method. Syntax of these methods is as follow: final boolean isAlive() final void join() throws InterruptedException final void join(long milliseconds) throws InterruptedExceptions The isAlive() method can be used to find whether the thread is still running or not. If the thread is still running, it will return true. Otherwise, it will return false. The join() method makes the thread to wait until the

The post What are the methods of the Thread Class appeared first on Coding Security.


What are the methods of the Thread Class
read more

Tidak ada komentar:

Posting Komentar