A.0
B.1
C.2
D.3
第1题:
下列代码的执行结果是( )。 public class Test{ public static void main(String[]args){ int[]x={0,1,2,3}; for{int i=0;i<3;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.errorl
B.error2
C.errorl orror2
D.2 error2
第2题:
执行如下语句之后,输出的结果是______。 public class ex24 { public static void main(String[] args) { int x=5,y=3; x+=X-- *--y; System.out.println{x); } }
A.0
B.1
C.true
D.false
第3题:
【分录题】写出以下程序运行结果。 public class Demo7 { public static void main(String[] args) { int i=1,j=0; int x=2; while(x<13) { for(;;) { if(i*j>10) break; i++; j++; } x=x+2; } System.out.println(x); System.out.println(i); System.out.println(j); } }
第4题:
执行下列代码段之后,x的值为______。 public class ex25 { public static void main(String[] args) { int x=12; int m=x%5; x>>>=m; System.out.println(x); }
A.7
B.3
C.0
D.1
第5题:
下列程序的输出结果中 x= [填空1] ? public class E { public static void main (String []args) { int x = 1,y = 6; while (y-->0) { x--;} System.out.print("x="+x); }}