选择题
10.
有如下代码:
public class X extends Thread implements Runable
{
public void run()
{
System.out.println("this is run()");
}
public static void main(String args[])
{
Thread t=new Thread(new X());
t.start();
}
}
程序的运行结果为______。
A、
第一行会产生编译错误
B、
第六行会产生编译错误
C、
第六行会产生运行错误
D、
程序会运行和启动
【正确答案】
D
【答案解析】
提交答案
关闭