public class TestThreadaLive {
public static void main(String[] args) {
SubThread sbt = new SubThread();
Thread tr = new Thread(sbt);
tr.start();
for(int i = 0; i < 50; i++){
System.out.println("Main Thread:" + i);
}
}
}
class SubThread implements Runnable{
public void run(){
System.out.println(Thread.currentThread().isAlive());
for(int i = 0; i < 100; i++){
System.out.println(Thread.currentThread().isAlive());
System.out.println("SubThread is Still alive? " + i);
}
}
}