给定以下JAVA代码,这段代码编译运行后输出的结果是( )
publicclassTest{
publicstaticintaMethod(inti)throwsException{
try{
returni/10;
}catch(Exceptionex){
thrownewException("exceptioninaaMothod");
}finally{
System.out.print("finally");
}
}
publicstaticvoidmain(String[]args){
try{
aMethod(0);
}catch(Exceptionex){
System.out.print("exceptioninmain");
}
System.out.print("finished");
}
}
A、finallyexceptioninmainfinished
B、exceptioninmainfinally
C、finallyfinished
D、finallyexceptioninmainfinished
第1题:
A."Hello"
B."good-bye"
C."Hello""god-bye"
D.代码不能编译
第2题:
Java 虚拟机 (JVM) 运行 Java 代码时,不会进行的操作时
A )加载代码
B )校验代码
C )编译代码
D )执行代码
第3题:
A.null
B.-1
C.编译时出错
D.运行时报错
第4题:
阅读下列代码:该代码的运行结果是( )。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
第5题:
Java虚拟机(JVM)运行Java代码时,不会进行的操作是( )。
A.加载代码
B.校验代码
C.编译代码
D.执行代码
第6题:
A.“hello”
B.“good-bye”
C.“hello”“good-bye”
D.代码不能编译
第7题:
阅读下列代码
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 )输出空
第8题:
A.x
B.x=x
C.“x=”+5
D.编译报错
第9题:
阅读下列代码 publicclassPerson{ staticintalt[]=newint[[10]; public static voidmain(Stringargs){ System.out.println{all[9]); } } 该代码的运行结果是( )。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
第10题:
给定java代码片段,如下:运行后,这段代码将输出()。
A.true
B.false
C.0
D.1