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

题目内容 (请给出正确答案)
单选题
如下代码:  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"); }   }  如果oneMethod正常运行,则输出结果中是?()
A

 condition 1   finally

B

 condition 2   finally

C

 condition 3   finally

D

 finally


参考答案

参考解析
解析: 暂无解析
更多 “单选题如下代码:  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"); }   }  如果oneMethod正常运行,则输出结果中是?()A  condition 1   finallyB  condition 2   finallyC  condition 3   finallyD  finally” 相关考题
考题 如下代码:publicvoidTest(){try{oneMethod();System.out.println(condition1);}catch(ArrayIndexOutOfBoundsExceptione){System.out.println(condition2);}catch(Exceptione){System.out.println(condition3);}finally{System.out.println(finally);}}如果oneMethod正常运行,则输出结果中是?()A.condition1finallyB.condition2finallyC.condition3finallyD.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

考题 已知如下代码: switch(m) { case 0: System.out.println("Condition0"); case 1: System.out.println("Condition 1"); case 2: System.out.println("Condition 2"); case 3: System.out.println("Condition 3"); break; default: System.out.println("Other cCndition"); } 当m为( )时,"Condition 2"会出现在输出结果中。A.2B.0、1C.0、1、2D.0、1、2、3

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

考题 publicclassTest{publicstaticvoidaMethod()throwsException{try{thrownewException();}finally{System.out.println(finally”);}}publicstaticvoidmain(Stringargs[]){try{aMethod();}catch(Exceptione){System.out.println(exception”);}System.out.println(finished”);}}Whatistheresult?()A.finallyB.exceptionfinishedC.finallyexceptionfinishedD.Compilationfails.

考题 下面程序输出的结果是什么? ( ) public class Quiz2 { public static void main(String args[]) { try {throw new MyException(); }catch(Exception e) { System.out.println("It's caught!"); }finally{ System.out.println("It's finally caught!"); } } } class MyException extends Exception{}A.It's finally caught!B.It's caught!C.It's caught!/It's finally caught!D.无输出

考题 下列代码的执行结果是( )。 public class Test{ public static void main(String[]args){ int[]x={0,1,2,3}; for{int i=0;i3;1+=2){ try{ systcm.OUt.println(x[i+2]/x[i]+x[i+1]); }catch(ArithmeticException e){ System.OUt.println("errorl"): }catch(Exception e){ System.OUt.println("error2"): } } } }A.errorlB.error2C.errorl orror2D.2 error2

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

考题 阅读下列程序片段 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 class Test{ Public static void main(String[]args){ int[]array=(2,4,6,8,10); int size=6; int result=-l: try{ for(int i=0;isizeresult= =-1:) if(array[i]= =20)result=i: } catch(ArithmeticException e){ System.out.println("Catch---1"); } catch(ArraylndexOutOfBoundsException e){ System.out.println("Catch---2"): } catch(Exception e){ System.out.println("Catch---3"): } }A.Catch---1B.Catch---2C.Catch---3D.以上都不对

考题 请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是( )。 程序代码: public class throwsExeeption{ static void Proc(intsel) throws Arithmetic Exception,Array Index Out Of Bounds Exception{ System.out.println("InSituation"+sel); if(sel= =0){ System.OUt.println("noException caught"); return; } else if(sel= =l){ int iArray[]=newint[4]; iArray[1]=3; } } public static void main(String args[]){ try{ Proe(O); Proc(1); } catch(Array Index Out Of Bounds Exception e){ System.out.println("Catch"+e); } finally{ System.out.println("inProcfinally"): } } } 执行结果: In Situation 0 no Exception caught in Proc finallyA.In Situation lB.In SituationC.with CatchD.int iArray l

考题 下列程序的输出结果是( )。 public class Test{ public static void main(String[]args){ int[]array=(2,4,6,8,lO); int size=6; int result =-1: try{ for(int i=0;i(size 8Lresult= = -1;) if(array[i]= =20)result=i: } catch(ArithmeticException e){ System.out.println("Catch- - -l"); } catch(ArraylndexOutOfBoundsException e){ System.out.println("Catch- - -2"); } catch(Exception e){ System.out.println("Catch- - -3");) } }A.Catch- - -1B.Catch- - -2C.Catch- - -3D.以上都不对

考题 有如下的代码段,当编译和运行时,下列各选项中说法正确的是( )。 public class Z { public static void main(String args[]) { new Z (); } Z() { Z alias1 = this; Z alias2 = this; synchronized(alias1) { try { alias2.wait(); System.out.println("DONE WAITING"); } catch (InterruptedException e) { System.out.println( "INTERRUPTED"); } catch (Exception e) { System.out.println("OTHER EXCEPTION"); } finally { System.out.println ("FINALLY"); } } System.out.println("ALL DONE"); } }A.应用程序编译正常,但是不打印任何数据B.应用程序编译正常,并打印数据“DONE WAITING”C.应用程序编译正常,并打印数据“FINALLY”D.应用程序编译正常,并打印数据“ALL DONE”

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

考题 下面程序输出的结果是什么? ( ) public class Quiz2 { public static void main(String args[]) { try {throw new MyException(); }catch(Exception e) { System.out.println("It's caught!"); }finally{ System.out.println("It's finally caught!"); } } } class MyExeeption extends Exception{}A.It's finally caught!B.It's caught!C.It's caught!/It'sfinally caught!D.无输出

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

考题 ( 17 )下列程序的输出结果是public class Test{public static void main(String[] args){int [] array={2,4,6,8,10};int size=6;int result=-1;try{for{int i=0;isize result==-1;i++}if(array[i]==20) result=i;}catch(ArithmeticException e){System.out.println( " Catch---1 " );catch(ArrayIndexOutOfBoundsException e){System.out.println( " Catch---2 " );catch(Exception e){System.out.println( " Catch---3 " );}}A ) Catch---1B ) Catch---2C ) Catch---3D )以上都不对

考题 如下代码:  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"); }   }  如果oneMethod正常运行,则输出结果中是?()A、 condition 1   finallyB、 condition 2   finallyC、 condition 3   finallyD、 finally

考题 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");    }  }  Which will display if oneMethod run normally?()    A、 condition 1B、 condition 2C、 condition 3D、 finally

考题 public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()  A、 finallyB、 exception finishedC、 finally exception finishedD、 Compilation fails.

考题 public static void main(String[] args) {  try {  args=null;  args[0] = “test”;  System.out.println(args[0]);  } catch (Exception ex) {  System.out.println(”Exception”);  } catch (NullPointerException npe) {  System.out.println(”NullPointerException”);  }  }  What is the result?() A、 testB、 ExceptionC、 Compilation fails.D、 NullPointerException

考题 单选题public static void main(String[] args) {  try {  args=null;  args[0] = “test”;  System.out.println(args[0]);  } catch (Exception ex) {  System.out.println(”Exception”);  } catch (NullPointerException npe) {  System.out.println(”NullPointerException”);  }  }  What is the result?()A  testB  ExceptionC  Compilation fails.D  NullPointerException

考题 单选题public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()A  finallyB  exception finishedC  finally exception finishedD  Compilation fails.

考题 多选题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");    }  }  Which will display if oneMethod run normally?()Acondition 1Bcondition 2Ccondition 3Dfinally

考题 单选题阅读下列程序片段: 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 ArrayIndexOutOfBoundExceptionC Exception finallyD hello finally