62,614
社区成员
发帖
与我相关
我的任务
分享
根据下面的代码,选择可能的结果:
(1)class Demo extends Thread implements Runnable{
(2) public void run(){
System.out.println("k");
}
public static void main(String []args) {
Thread t=new Thread(new Demo());
(3) t.start();
}
}
a.代码(1)出错.
b. 代码(2)出错
c. 代码(3)出错
d.正常输出”k”
public void run() {
System.out.println("k");
}