[单选题]

阅读下列程序片段。

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

参考答案与解析:

相关试题

阅读下面程序public void test() { try{ sayHello

[单选题]阅读下面程序 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

  • 查看答案
  • ( 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 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 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 Test {public static

    [单选题]阅读下列程序: public class Test { public static void main (String args[]) { int x=3; for (int i=1;i<=10; i++) x=x+i/4; System. out. println(x);} }程序的输出结果是( )。A.12B.13C.14D.15

  • 查看答案
  • ( 18 )阅读下列程序Public class Test implements

    [单选题]( 18 )阅读下列程序Public class Test implements Runnable{Private int x=0;Private int y=o;boolean flag=true;Public static void main(string[ ] args) {Test r =new Test( );Thead t1=new Thead(r);Thead t2=new Thead(r);t1.start( );t2.start( );}Public void run(){Wh

  • 查看答案
  • 请阅读下面程序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

  • 查看答案
  • 下列程序的输出结果是Class Test{public static void

    [单选题]下列程序的输出结果是Class Test{public static void main(String args[]){int n=7;n<<3;n=n&下列程序的输出结果是 Class Test{ public static void main(String args[]){ int n=7; n<<3; n=n&n+1|n+2^n+3; n>>=2; System.out.println(n); ) }A.0B.-1C.14D.64

  • 查看答案
  • 阅读下列程序片段。Public void test{Try{sayHello;s