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) ArrayIndexOutOfBondsException
C) Exception
F.inally
D) Hello
F.inally
[单选题]阅读下列程序片段。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(); System.out.println("hello"); } catch(ArrayIndexOutOfBoundException e) { System.out.println("ArrayIndexOutOfBoundException"); } catch(Exception e) { System.out.println("Exception"); } finally { System
[单选题]阅读下列程序片段 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 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 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 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 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 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
[单选题]下列程序的输出结果是class Test{public static void main(String args[]){int n=7;n<<=3;n=n&am下列程序的输出结果是 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 class Test{ static void print(String s,int i){ System.out.println("String:"+s+",int:"+i); } static void print(int i,String s){ System.out.println("int:"+i+",String:"+s); } public static void main(String[]args){ print(99,"I