[单选题]

阅读下面程序 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.ArraylndexOutOfBondsException

C.Exception Finally

D.Hello Finally

参考答案与解析:

相关试题

阅读下列程序片段。Public void test{Try{sayHello;s

[单选题]阅读下列程序片段。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

  • 查看答案
  • ( 26 )阅读下列程序片段Public void test(){Try{say

    [单选题]( 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 {Syste

  • 查看答案
  • 阅读下列程序片段Publicvoidtest(){Try{sayHello();

    [单选题]阅读下列程序片段 Publicvoidtest(){ Try{ sayHello(); system.out.println(“hello"); }catch(ArrayIndexOutOfBoundExceptione){ System.out.println(“ArraylndexOutOfBoundException”); }catch(Exceptione){ System.out.println(“Exception”); }finally{ System.out.println(“

  • 查看答案
  • 请阅读下面程序public class Test {public static

    [主观题]请阅读下面程序public class Test {public static void main (String[] args) {int i,j;for (i=1;i<5;i++) {for (j=1;j<=i;j++)system.out.print (i+"X"+j+"="+i*j+" ");System.out.println();}}}程序执行完后,i循环和j循环执行的次数分别是[ ]。

  • 查看答案
  • 阅读下面程序public class Test2 ______ { public

    [单选题]阅读下面程序 public class Test2 ______ { public static void main(String[] args) { Thread t=new Test2(); t.start(); } public void run() { System.out.println("How are you."); } } 程序中下画线处应填入的正确选项是A.implements ThreadB.extends RunnableC.implements RunnableD.e

  • 查看答案
  • 阅读下面程序1 public class Try extends Thread

    [单选题]阅读下面程序 1 public class Try extends Thread { 2 public static void main(String args[]) { 3 Try t=new Try(); 4 t.start(); 5 } 6 7 public void run(int j) { 8 int i=0; 9 while(i<5) { 10 System.out.println("祝你成功!"); 11 i++: 12 } 13 } 14 } 该程序若能打印5行“祝你成功!”

  • 查看答案
  • 阅读下面程序public class Test2______ {public s

    [单选题]阅读下面程序 public class Test2______ { public static void main(String[] args){ Thread t=new Test2(); t. start(); } public void run(){ System. out. priatln("How are you. "); } } 在程序下画线处填入的正确的选项是A.implements ThreadB.extends RunnableC.implements RunnableD.

  • 查看答案
  • 阅读下面程序 public class Test1 {public static

    [单选题]阅读下面程序 public class Test1 { public static void main(String[] args){ System.out.println(34+56-6); System.out.println(26*2-3); System.out.println(3*4/2); System.out.println(5/2); } } 程序运行结果是A.84 49 6 2B.90 25 6 2.5C.84 23 12 2D.68 49 14 2.5

  • 查看答案
  • 阅读下面程序 public class Test3 { public stati

    [单选题]阅读下面程序 public class Test3 { public static void main(String args[]){ int x=3, y=4, z=5; String s="xyz"; System.out.primln(s+x+y+z); } } 程序运行的结果是A.xyzl2B.xyz345C.xyzxyzD.12xyz

  • 查看答案
  • 阅读下面程序public class Test2 {public static

    [单选题]阅读下面程序 public class Test2 { public static void main(String args[]){ int a=1O, b=4, c=20, d=6; System.out.println(a++*b+c*--D) ; } } 程序运行的结果是A.144B.160C.140D.164

  • 查看答案
  • 阅读下面程序public void test() { try{ sayHello