[单选题]

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

参考答案与解析:

相关试题

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

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

  • 查看答案
  • 阅读下列程序片段:<br />publicvoidtest()<img border="0" src="https://img.zhaotiba.com

    [单选题]阅读下列程序片段:publicvoidtest()trysayHello();system.out.println("hello");catch(Ar

  • 查看答案
  • 阅读下面程序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行“祝你成功!”

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

    [单选题]阅读下面程序 1public class Try extends Thread{ 2public static void main(String args[]){ 3Tryt=new Try(); 4t.start(); 5} 6 7publicvoidrun(intj){ 8inti=0; 9while(i<5){ 10System.out.println("祝你成功!"); 11 i++; 12} 13} 14} 该程序要求打印5行“祝你成功!”,必须改正程序中的某行代码,程序才能完成。

  • 查看答案
  • ( 28 )阅读下面程序1 public class Try extends T

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

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

    [单选题]阅读下面程序 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行“祝你成功!”,必须改正程

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

    [单选题]3阅读下面程序 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.pfintln("祝你成功"); 11 i++; 12 } 13 } 14 } 该程序要求打印5行“祝

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

    [单选题]阅读下面程序 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行“祝你成功!”,必须改正程

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