//第四种
//用户线程可以被System.exit(0)强制kill掉,所以也只打印出七句
thread.start();
System.out.println("main thread is over");
System.exit(1);
}
public static class ThreadDemo extends Thread{
@Override
public void run() {
for (int i = 0; i < 100; i++) {
System.out.println("This is a Thread test"+i);
}
}
}
}