下面的程序编译运行后输出的结果是( )。public class A implements Runnable {public static void main(String argv[]) {A a = new A();Thread t = new Thread(a);t.start();}public void run() {while(true) {try{Thread.currentThread().sleep(1000);}catch(InterruptedException e){System.out.println(e.toString());}System.out.println("looping while");}}}
A. 在屏幕上重复输出 "looping while"。
B. 在屏幕上输出一次 "looping while"。
C. 没有结果输出。
D. 出现编译错误。
对于线程的生命周期,下面四种说法正确的有哪些? (多选)()
A. 调用了线程的start()方法,该线程就进入运行状态
B. 线程的run()方法运行结束或被未catch的InterruptedException 等异常终结,那么该线程进入死亡状态
C. 线程进入死亡状态,但是该线程对象仍然是一个Thread对象,在没有被垃圾回收器回收之前仍可以像引用其他对象一样引用它
D. 线程进入死亡状态后,调用它的start()方法仍然可以重新启动