>

Wednesday, December 19, 2012

Thread Program three in Java


What is out put?

public class Thread_Demo extends Thread{

public void run(){
System.out.println("Some text");
}

public static void main(String[] args) throws InterruptedException {

Thread_Demo t=new Thread_Demo();
Thread_Demo td1=new Thread_Demo();
t.run();
System.out.println("ISALIVE :"+t.isAlive());
t.sleep(500);
System.out.println("ISALIVE :"+t.isAlive());
t.destroy();
System.out.println("ISALIVE :"+t.isAlive());
}

}

No comments:

Post a Comment

Please post your comments. Your comments make us to write more programs for you.