阅读下列程序片段。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

阅读下列程序片段。

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.Hello

B.ArraylndexOutOfBondsException

C.ExceptionFinally

D.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) HelloB) ArrayIndexOutOfBondsExceptionC) ExceptionFinallyD) HelloFinally

使用VC6打开考生文件夹下的工程test17_1,此工程包含一个源程序文件test17_1.唧,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下:Vehicle messageCar messageVehicle message源程序文件test17_1.cpp 清单如下:include <iostream.h>class vehicle{int wheels;float weight;public:/***************** found *****************/void message(void){ cout<<"Vehicle message\n";}};class car:public vehicle{int passenger_load;public:/***************** found *****************/void message (void){cout>>"Car message\n";}};class truck:public vehicle{int passenger_load;float payload;public:int passengers(void){return passenger_load;}};void main(){vehicle * unicycle;unicycle=new vehicle;/***************** found *****************/unicycle.message()delete unicycle;unicycle=new car;unicycle->message();delete unicycle;unicycle=new truck;unicycle->message();delete unicycle;}

下列程序的运行结果是【 】。 include class test { private: int num; public: tes 下列程序的运行结果是【 】。include <iostream. h>class test{private:int num;public:test()int TEST() {return num+100;}~test()};test::test(){num=0;}test::~test(){cout<<"Destructor is active"<<endl;}void main(){test x[3]cout<<x[1]. TEST()<<endl;}

下列程序的运行结果是______。 include class test { private: int hum; public: tes 下列程序的运行结果是______。include<iostream.h>class test{private:int hum;public:test( );int TEST( ){return num+100;)~test( );};test::test( ){num=0;)test::~test( ){cout<<"Destructor is active"<<endl;)void main( ){test x[3];cout<<x[1].TEST( )<<endl;}

如下的代码段中,如果方法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

如果下列的方法能够正常运行,在控制台上将不显示()选项。 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