在Java中,运行下列程序, 会产生什么结果public class X extends Thread implements R

分类: 中级Java开发工程师 发布时间: 2023-11-03 11:08 浏览量: 0

在Java中,运行下列程序, 会产生什么结果public class X extends Thread implements Runable{ //1public void run(){ //2System.out.println("this is run()"); //3} public static void main(String args[]) //4{ Thread t=new Thread(new X()); //5t.start(); //6} }

A.第一行会产生编译错误

B.第六行会产生编译错误

C.第六行会产生运行错误

D.程序会运行和启动

正确答案是D