In this article we will learn some of the thread methods like isAlive, join, suspend, resume, and stop along with sample Java programs. isAlive() and join() Methods Even though threads are independent most of the time, there might some instances at which we want a certain thread to wait until all other threads complete their execution. In such situations we can use isAlive() and join() methods. Syntax of these methods is as follows: final boolean isAlive() final void join() throws InterruptedException final void join(long milliseconds) throws InterruptedException The isAlive() method can be used to find whether the thread is still running
The post What are different thread class methods in java programming appeared first on Coding Security.
What are different thread class methods in java programming
read more
Tidak ada komentar:
Posting Komentar