2:50 am - Tuesday November 13, 2018

Thread Example program for join(long mills,int nanos)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
**
program : Java using join.
author : "candid"
date :22.11.2012
*/
public class Join1 implements Runnable
{
public void run()
{
Thread th = Thread.currentThread();
System.out.println(th.getName()+" is alive "+th.isAlive());
}
public static void main(String args[]) throws Exception
{
Thread th = new Thread(new Join1());
th.start();
th.join();
System.out.println(th.getName()+" is alive "+th.isAlive());
}
}


output:

thread 0- is alive true
thread 0- is alive false

Filed in: Z-A All Java Codes

Comments are closed.