网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

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

B.ArraylndexOutOfBondsException

C.Exception Finally

D.Hello Finally


参考答案

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

考题 ( 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

考题 在oneMethod( )方法运行正常的情况下,程序段将输出( )。 public void test( ){ try {oneMethod( ); System.out.println ("condition 1"); }catch (ArratlndexOutOfBoundException e){ System.out.println("condition2"): }catch (Exception e){ System.out.println("condition 3"); }finnally{ System.out.println("finally"): } }A.condition 1B.condition2C.condition 3D.condition 1 finally

考题 在oneMethod()方法运行正常的情况下,程序段将输出public void test(){ try { oneMethod(); System.out.println("condition 1"); } catch(ArrayIndexOutOfBoundsException e){ System.out.println("condition 2"); } catch (Exception e) { System.out.println("condition 3"); } finally { System.out.println("finally"); }}A.condition 1B.condition 2C.condition 3D.condition 1 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.Exception FinallyD.Hello Finally

考题 在oneMethod( )方法运行正常的情况下,程序段将输出什么? public void test( ){ try { oneMethod( ); System.out.println("condition 1"); } catch (ArrayIndexOutOfBoundsException e){ System.out.println("condition 2"); } catch(Exception e){ System.out.println("condition 3"); } finally { System.out.pritln("finally"); } }A.condition 1B.condition 2C.condition 3D.condition 1

考题 在oneMethod()方法运行正常的情况下,程序段将输出______。 public void test() { try{ oneMethod(); System.out.println("ndition 1"; } catch (ArrayIndexOutOfVoundsException e){ System.out.println("ondition 2"; } catch (Exception e){ System.out.println("ondition 3"; } finally{ System.out.println ( "inally"; } }A.condition1B.condition2C.condition3D.condition1 finally

考题 在oneMethod()方法运行正常的情况下,程序段将输出什么? ( ) public void test() { try { oneMethod(); System.out.println("condition 1"); } catch(ArrayIndexOutOfBoundsException e) { System.out.println("condition 2"); } catch(Exception e) { System.out.println("condition 3"); } finally { System.out.println("finally");A.condition 1B.condition 2C.condition 3D.condition 1 finally

考题 为了向文件hello.txt尾部追加数据,下列哪个是正确创建指向hello.txt的流()A.try{ OutputStream out=new FileOutputStream("hello.txt"); }catch(IOException e) { }B.try{ OutputStream out=new FileOutputStream("hello.txt",true); }catch(IOException e) { }C.try{ OutputStream out=new FileOutputStream("hello.txt",false); }catch(IOException e) { }D.try{ OutputStream out=new OutputStream("hello.txt",true); }catch(IOException e) { }