单项选择题
运行下列程序,会产生什么结果 ( ) public class X exlends 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.程序会运行和启动
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
运行下列程序的结果是 ( ) abstract class MineBase { abstract void amethod(); static int i; } public class Mine extends MineBase { public static void main(String argv[]){ int[]ar=new int[5]; for(i=0;i<ar.length;i++) System.out.println(ar[i]);
A.打印5个0
B.编译出错,数组ar[]必须初始化
C.编译出错,Mine应声明为abstract
D.出现IndexOutOfBoundes的例外
点击查看答案
单项选择题
下列语句序列执行后,j的值是 ( ) int j=3,i=2; while(- -i!=i j) j=j+2;
A.2
B.4
C.6
D.5
点击查看答案
相关试题
Java流程控制结构不包括 ( )
软件工程是一种 ______ 分阶段实现...
在下列事件处理机制中哪个不是机制中的角色...
对Java中类的构造方法描述正确的是 ( )
以下哪个方法仅在Applet程序被创建和首次被...