-->
当前位置:首页 > 题库 > 正文内容

单选题:运行下列Java程序, 会产生什么结果

Luz4年前 (2021-12-25)题库1094
运行下列Java程序, 会产生什么结果

1 public class X extends Thread implements Runnable{
2 public void run(){
3 System.out.println("this is run()");
}
4 public static void main(String args[])
{
5 Thread t=new Thread(new X());
6 t.start();
}
}




A.第一行会产生编译错误
B.第六行会产生编译错误
C.第六行会产生运行错误
D.程序会正常编译和运行,输出:this is run()


答案:D

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。