运行下列程序,会产生什么结果publicclassXextendsThreadimplementsRunable{publicvoidrun(){System.out.println(“thisisrun()“);}publicstaticvoidmain(Stringargs[]){Threadt=newThread(newX());t.start();}
A、第一行会产生编译错误
B、第六行会产生编译错误
C、第六行会产生运行错误
D、程序会运行和启动
第1题:
阅读下列代码
Public class Person{
Static int arr[ ] = new int (10);
Public static void main (String args ) {
System.out.println(arr[9]);
}
}
该代码运行的结果是
A )编译时将产生错误
B )编译时正确,运行时将产生错误
C )输出 0
D )输出空
第2题:
A.go
B.编译失败
C.代码运行,无输出结果
D.运行时异常被抛出
第3题:
对下列程序的叙述中,正确的是( )。
A.第1行会产生编译错误
B.第6行会产生编译错程
C.第6行会产生运行错误
D.程序正常运行
第4题:
阅读下列代码 publicclassPerson{ staticintalt[]=newint[[10]; public static voidmain(Stringargs){ System.out.println{all[9]); } } 该代码的运行结果是( )。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
第5题:
对下列程序的叙述中,正确的是( )。
A.第1行会产生编译错误
B.第6行会产生编译错误
C.第6行会产生运行错误
D.程序正常运行
第6题:
阅读下列代码后 publicclass Person{ intarr[]=new int[10]; publicstaticvoidmain(Stringargs[]){ System.out.println(alt[1]); } } 正确的说法是( )。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
第7题:
对下列程序的叙述中,正确的是( )。 1:public class X extends Thread implements Runnable{ 2:public void run{ 3:system.out.println("this is run"); 4:} 5:oublic static void main(String args[]){ 6:Thread t=new Thread(new X): 7:t.start; 8:} 9:}
A.第l行会产生编译错误
B.第6行会产生编译错程
C.第6行会产生运行错误
D.程序正常运行
第8题:
对下列程序的叙述中,正确的是( )。 1)public class X extends Thread implements Runnable{ 2)public void run{ 3)system.out.println("this is run"); 4)} 5)public static void main(String args[]){ 6)Thread t=new Thread(new X); 7)t.start; 8)} 9)}
A.第l行会产生编译错误
B.第6行会产生编译错误
C.第6行会产生运行错误
D.程序正常运行
第9题:
●以下关于程序的叙述中,错误的是__(30) 。
(30)
A.有编译错误的程序一定包含着错误
B.运行结果正确的程序也可能含有错误
C.调用了未定义的函数会产生链接错误
D.调用了未定义的函数会发生运行异常
第10题:
关于以下程序段的说法正确的是()。 1.publicclassMyar{ 2.publicstaticvoidmain(Stringargv[]){ 3.int[]i=newint[5] 4.System.out.println(i[5]) 5.}
第11题:
VB程序通常不会产生错误提示的是()。
第12题:
第2行编译出错
第4行编译出错
编译时产生错误
编译时没有产生错误,运行时发生异常
第13题:
A.输出零
B.输出空
C.编译时正确,运行时将产生错误
D.编译时将产生错误
第14题:
classThreadBothextendsThreadimplementsRunnable{publicvoidrun(){System.out.print("hi");}publicstaticvoidmain(String[]args){Threadt1=newThreadBoth();Threadt2=newThread(t1);t1.run();t2.run();}}结果为:()
A.hi
B.hihi
C.编译失败
D.代码运行,但无输出结果
第15题:
VB程序中通常不会产生错误提示的()。
A.编译错误
B.实时错误
C.逻辑错误
D.运行时错误
第16题:
阅读下列代码: public class Person{ static int arr[]=new int[10]; public static void main(String args){ System.out.println{arr[9]); } } 该代码的运行结果是( )。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
第17题:
阅读下列代码:该代码的运行结果是( )。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
第18题:
关于以下程序段的执行结果,说法正确的是()。publicclassborleyextendsThread(publicstaticvoidmain(Stringargv[]){borleyb=newborley();b.start();}publicvoidrun(){System.out.println("running");}}
A.编译通过并执行,但无输出
B.编译通过并执行,输出:running
C.产生错误,没有thread类对象
D.产生错误,没有通道到达thread包
第19题:
关于下面程序,( )的结论是正确的。
publicclassJ_Test{
publicstaticvoidmain(String[]args){
try{
return;
}
finally{
System.out.println("1");
}
}
}
A、上面程序含有编译错误
B、上面程序在运行时会产生一个运行时异常
C、上面程序会正常运行,但不产生任何输出
D、上面程序输出“1”
第20题:
运行下列程序,会产生什么结果? ( ) 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.程序会运行和启动
第21题:
第22题:
在JAVA语言中,为将源代码翻译成()文件时产生的错误称为编译错误。而将程序在运行中产生的错误称为运行错误。
第23题:
编译错误
实时错误
运行时错误
逻辑错误