( 26 )阅读下列程序片段Public void test(){Try{sayHello();system.out.println( “ hello ” );} catch (ArrayIndexOutOfBoundException e) {System.out.println( “ ArrayIndexOutOfBoundException ” );}catch(Exception e){System.out.println( “ Exception ” );}finally {System.out.println( “ finally ” );}}如果 sayHello( ) 方法正常运行,则 test( ) 方法的运行结果将是A) HelloB) ArrayIndexOutOfBondsExceptionC) ExceptionFinallyD) HelloFinally

( 26 )阅读下列程序片段

Public void test(){

Try{

sayHello();

system.out.println( “ hello ” );

} catch (ArrayIndexOutOfBoundException e) {

System.out.println( “ ArrayIndexOutOfBoundException ” );

}catch(Exception e){

System.out.println( “ Exception ” );

}finally {

System.out.println( “ finally ” );

}

}

如果 sayHello( ) 方法正常运行,则 test( ) 方法的运行结果将是

A) Hello

B) ArrayIndexOutOfBondsException

C) Exception

Finally

D) Hello

Finally


相关考题:

阅读下列程序片段。Public void test{Try{sayHello;system.out.println(hello):}catch(ArraylndexOutOfBoundException e){System.out.println(ArraylndexOutOfBoundExcep—tion);}catch(Exception e){System.out.println(Exception):}finally{System.Out.println(finally);}}如果sayHello方法正常运行,则test方法的运行结果将是( )。A.HelloB.ArraylndexOutOfBondsExceptionC.ExceptionFinallyD.HelloFinally

清在下划线处填入代码,使程序正常运行并且输出“Hello!”classTesl______{publicstaticvoidmain(string[]args){Test=newTest();t.start();}Pubhcvoidrun(){System.out.println("Hello!");}}

如下的代码段中,如果方法unsafe()正常运行,那么结果是( )。 public void example() { try { unsafe(); System.out.println("Testl"); }catch(SafeException e) { System.out.println("Test 2"); }finally{ System.out.println("Test 3'); } System.out.println("Test 4"); }A.Test 3 Test 4B.Test1 Test3 Test4C.Test1 Test3D.Test1 Test4

阅读下列程序片段。 Public void test{ Try{ sayHello; system.out.println("hello"): }catch(ArraylndexOutOfBoundException e){ System.out.println("ArraylndexOutOfBoundExcep— tion"); }catch(Exception e){ System.out.println("Exception"): }finally{ System.Out.println("finally"); } } 如果sayHello方法正常运行,则test方法的运行结果将是( )。A.HelloB.ArraylndexOutOfBondsExceptionC.Exception FinallyD.Hello Finally

阅读下列程序片段。如果sayHello( )方法正常运行,则test( )方法的运行结果将是( )。A.HelloB.ArrayIndexOutOfBondsExceptionC.ExceptionFinallyD.HelloFinally

阅读下列程序片段 Publicvoidtest(){ Try{ sayHello(); system.out.println(“hello"); }catch(ArrayIndexOutOfBoundExceptione){ System.out.println(“ArraylndexOutOfBoundException”); }catch(Exceptione){ System.out.println(“Exception”); }finally{ System.out.println(“finally”); } } 如果sayHello()方法正常运行,则test()方法的运行结果将是( )。A.HelloB.ArraylndexOutOfBondsExceptionC.Exception FinallyD.Hello Finally

下面的程序执行后,文件test中的内容是 void fun(char *fname, char *st) { FILE *myf; int i; myf=fopen (fname, "w"); for(i=0; i<strlen(st); i++) fputc(st[i], myf); fclose(myf); } int main(void){ fun("test", "new world"); fun("test", "hello,"); return 0; }A.new worldhello,B.hello,C.new worldD.hello,rld

下面的程序执行后,文件test.t中的内容是 ()。 #include <stdio.h> void fun(char *fname,char *st) {FILE *myf;int i; myf=fopen(fname,"w"); for(i=0;i<strlen(st);i++) fputc(st[i],myf); fclose(myf); } int main(void) { fun("test.t","new world"); fun("test.t","hello,"); return 0; }A.hello,B.new worldhello,C.new worldD.hello,rld

如果下列的方法能够正常运行,在控制台上将不显示()选项。 public void example() { try{ unsafe();     System.out.println("Test1"); }catch(SafeException e) { System.out.println("Test2"); }finally{ System.out.println("Test3"); } System.out.println("Test4"); }A.Test1B.Test2C.Test3D.Test4