class Thread18 implements Runnable
{
public void run()
{
Thread t = Thread.currentThread();
System.out.print(t.getName());
System.out.println(", status = " + t.isAlive());
}
public static void main(String surat[]) throws Exception
{
Thread t = new Thread(new Thread18());
t.start();
t.join();
System.out.print(t.getName());
System.out.println(", status = " + t.isAlive());
}
}
Output:
{
public void run()
{
Thread t = Thread.currentThread();
System.out.print(t.getName());
System.out.println(", status = " + t.isAlive());
}
public static void main(String surat[]) throws Exception
{
Thread t = new Thread(new Thread18());
t.start();
t.join();
System.out.print(t.getName());
System.out.println(", status = " + t.isAlive());
}
}
Output:
No comments:
Post a Comment