全部题库 / Java / 试题详情
单选题 Java
2014-03-15

下面程序段的输出结果是(  )。

A.t has been created.
B.t has been created.
t is running.
C.t is running.
D.编译出错

参考答案

B

答案解析

start(  )方法就可以启动该线程,线程也就处于可运行状态Runnable。Start(  )方法产生了线程运行需要的系统资源,并调用线程体,也就是run(  )方法,使得线程可以进入运行状态。程序运行时首先创建-个新的线程对象t,并调用display(  )utput(Strings)方法输出t has beencreated。t.start(  )方法调用run(  )方法,输出t is running,所以正确答案为选项B。

你可能感兴趣的试题

A.ArrayIndexOutOfBoundsException
B.NumberFormatException
C.ArithmeticException
D.EOFException
A.a=true b=false
b=true C=true
B.a=true b=false
b=true e=false
C.a=true b=true
b=true C=false
D.a=false b=false
b=true C=false