A.a=true b=false b=true c=false
B.a=true b=false b=true c=true
C.a=true b=true b=true c=false
D.a=false b=false b=true c=false
[单选题]下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.println(”a=”+a+”b=+b) ; c=(b==false); System.out.printhln(”b=”+b+”c=”+c) ; } }A.a=true b=false b=true c=falseB.a=true b=false
[单选题]下面程序段的输出结果是 public class Test { public static void main(String args[]){ int[] a=new int[11]; int[] p=new int[4]; int k=5; for(int i=1;i<=10;i++) a[i]=i; for(int i=l;i<=3;i++) p[i]=a[i*i]; for(int i=1;i<=3;i++) k=k+p[i]*2; System.out.println(k); } }A.
[单选题]下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int a,b; for(a=1,b=1;a<=100;a++){ if(b>=10)break; if(b%2==1){ b+=2; continue; } } System.out.println(a) ; } }A.5B.6C.7D.101
[单选题]下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int a,b; for(a=1, b=1; a<=100; a++){ if(b>=10)break; if (b%2==1){ b+=2; continue; } } System.out.println(A); } }A.5B.6C.7D.101
[单选题]下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int x,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; y=(int)Math.sqrt(3)/2+(iht)Math.random()*3/2; if(x>y) System.out.println("x>y"); else if (x==y) System.out.println("x=y"
[单选题]下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int n=5,sum=O; while(n>0){ sum+=n; --n; } System.out.println("sum is "+Sum); } }A.sum is 14B.sum is 15C.sum is 10D.sum is 5
[单选题]下面程序的输出结果是 public class Test{ public static void main(String[] args){ int[]array={2,4,6,8,10}; int size=6; int result=-1: try{ for(int i=0;i<size&&result==-1;i++) if(array[i]==20)result=i; }catch(ArithmeticException e){ System.out.println("C
[单选题]下列语句输出结果为 ( ) public class test { public static void main(String args[]) { int a=-67,b=116,c=78; int e=~c>>2&(a|~B) ; System.out.println(e); } }A.70B.-84C.65D.-80
[单选题]下面程序的输出结果为( )。 public class Test { public static void main (String args[]) { String X="ABCD"; String Y="EFG"; X=X.substring (X.length()-Y.length()); System.out.println(X); } }A.ABCB.BCDC.EFGD.ABCDEFG
[单选题]下面程序段的输出结果是( )。 public class Test { public static void main ( String[] args) { int result=0; for ( int i=1;i<=5;i++) { if ( i%2==0 ) continue; result + =i; } System. out. println ("result is " + result ); } }A.result is 7B.result is 8C.result is 9D