package thread;
class ThreadTest implements Runnable{
public void run() {
int i=0;
// TODO 自动生成方法存根
while(true){
System.out.println(Thread.currentThread().getName()+" "+ i++ +" is running ...");
}
}
}
public class DaemonThread {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自动生成方法存根
ThreadTest t=new ThreadTest();
Thread tt=new Thread(t);
tt.setDaemon(true);
tt.start();
}
}