当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

阅读下面程序class Test implements Runnable {public static void main(String[] args) {Test t


阅读下面程序 class Test implements Runnable { public static void main(String[] args) { Test t = new Test(); t.startO; } public void run(){ } } 下列关于上述程序的叙述正确的是

A.程序不能通过编译,因为start()方法在Test类中没有定义

B.程序编译通过,但运行时出错,提示start()方法没有定义

C.程序不能通过编译,因为run()方法没有定义方法体

D.程序编译通过,且运行正常

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题
  • 下面程序段的输出结果是______。class Test{ public static void main(String args[ ]){ MyThread

  • 对下列程序的叙述中 正确的是( )。 1)public class X extends Thread implements Runnable{ 2)

  • 阅读下列代码public class Test implements Runnable{public void run(Thread t){System. out. p

  • 阅读下面程序public class Increment } public static void main(String args[]) { int c; c=5

  • 3阅读下面程序1public class Try extends Thread{ 2public static void main(String args[ ]){ 3

  • 阅读下面程序1public class Try extends Thread{2public static void main(String args[]){3Try