网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
程序: class TestApp{ public static void main (String[] args){ int x=6; if (x>l) System. out. println("x>l"); else if (x>5) System. out .println("x>5"); else if (x<10) System. out. println("x
A

x>5

B

x>l

C

x<10

D

x<29


参考答案

参考解析
解析: 暂无解析
更多 “单选题程序: class TestApp{ public static void main (String[] args){ int x=6; if (xl) System. out. println("xl"); else if (x5) System. out .println("x5"); else if (x10) System. out. println("x A x5B xlC x10D x29” 相关考题
考题 阅读下列代码 public class Test{ public static void main(String args[]){ System. out. println((2<0)? 10:8); } } 其运行结果是A.2B.0C.10D.8

考题 阅读下列代码 public class Test{ String s="One World One Dream"; public static void main(String args[]){ System. out. println(s); } } 其运行结果是A.argsB.One World One DreamC.sD.编译时出错

考题 下面程序的运行结果是( )。 public class Test { public static void main (String args[]) { int c=5; System. out. println (C); System. out. println (c++); System. out. println (C); } }A.5 6 6B.5 5 6C.6 7 7D.6 6 6

考题 下列程序中的循环体将会被执行( )。 public class Test { public static void main ( String[ ] args) { int i=3; do { System. out. println ( "Java."); i--; } while ( i >= 0 ); } }A.1次B.2次C.3次D.4次

考题 程序:classTestApp{publicstaticvoidmain(String[]args){intx=6;if(xl)System.out.println(xl);elseif(x5)System.out.println(x5);elseif(x10)System.out.println(xSystem.out.println(x29);elseSystem.out.println(以上都不是”);}}上述程序运行后的结果是哪项?()A.x5B.xlC.x10D.x29

考题 下列程序执行的结果是______。 public class exl3 { public static void main(String[] args) { int a=100,b=4; do{ a/=b; }while (a>10b++<10); System. out. println (a); } }A.12B.6C.24D.5

考题 执行下列程序段之后,变量b的值为( )。 public class Test { public static void main (String[] args) { int i = 12; int j = 24; boolean b1 = true; booleanb=(j%i==0)(! b1) || (j/i! =2); System. out. println (B); } }A.trueB.falseC.0D.1

考题 下面程序段的输出结果是( )。 public class Test t public static void main(String[] args) { int x=0; for (int i=1;i<=4;i++) { x=4; for(int j=1;j<=3; j++) { x=3; for(int k=1; k<=2; k++) x=x+6; } } System. out. println (x); } }A.36B.48C.144D.15

考题 执行下列代码后,输出的结果为( )。 class Base { int x = 30; void setX( ) {x=1O;} } class SubClass extends Base { int x=40; void setX ( ) {x=20;} int getX( ) {return super. x; } } public class Test { public static void main(String[ ] args) { SubClass sub=new SubClass( ); sub. setX( ); System. out. println(sub, getX( ) ); } }A.10B.20C.30D.40

考题 阅读下面程序 pubic class Cycle{ public static void main(String args[]){ System. out. println(args[0]); 在命令行中输入java Cycle one two,该程序输出结果是A.CycleB.oneC.twoD.上述A、B、C、均不对

考题 下列程序的输出结果是( )。 public class Test { public static void main(String[] args) { char a1 = 'B', a2 = 'c'; if(a1+1<a2) ++a1; System. out. println(a1); } }A.BB.bC.CD.c

考题 执行下列程序段之后,变量n的值为( )。 public class Test { public static void main(String[ ] args){ int y = 2; int z = 3; int n = 4; n=n+-y* z/n; System. out. println(n); } }A.3B.-1C.-12D.-3

考题 执行下列程序段之后,输出的结果是( )。 public class Test{ public static void main(String[ ] args) { byte a = 2; short b = 3; long c = 4; c=a%b*4%b; System. out. println(C); } }A.2B.1C.-1D.-2

考题 请将下面程序补充完整。public class PowerCalc{public static void main(String[]args){double x=5.0;System. out. println(x+"to the power 4 is"+power(x, 4));System. out. println("7. 5 to the power 5 is"+power(7.5, 5));System. out. println("7.5 to the power 0 is"+power(7.5, 0));System. out. println("10 to the power -2 is"+power(10, -2));}static double【 】 (double x, int n){if(n>1)return x * power(x, n-1);else if(n<0)return 1.0/power(x, -n);elsereturn n==0 ? 1.0:x;}}

考题 执行下列程序后,输出结果为( )。 public class Test { public static void main (String[] args) { StringBuffer sb = new StringBuffer("北京 2008" ); System. out. println ("length =" + sb. length ( ) ); } }A.length = 8B.length = 10C.length = 6D.length = 20

考题 下列程序执行的结果是______。 public class exl4 { public static void main(String[] args) { int a=3; int b=5; int c=4; if ( ( ! (a==b)) (a!=b) (a<b| |b<a) ) System.out.println ("good!"); else if {a*a+c* c==b*b] System. out.println (b); else System.out.println (a+c); } }A.7B.5C.25D.good!

考题 写出下面程序的输出( )。 public class Test { public static void main (String args[ ]) { iht x=1, y=2; System. out. println ("result="+x+y); System. out. println ("result="+(x+y));A.result=12 result=12B.result=3 result=3C.result=3 result=12D.result=12 result=3

考题 下面的语句片段中,变量result结果为( )。 public class Test { public static void main (String args[ ]) { int sum=0; int r=2; iht result=(sum==1?sum:r); System. out. println (result); } }A.1B.2C.10D.0

考题 有如下程序 public class Sun { public static void main (String args[ ]) { int a=2, b=1, c=2; if (a<B) if (b<0) if (c<0) c=0; else c++; System. out.println(C) ; } } 上述程序的运行结果是( )。A.0B.1C.2D.3

考题 下列代码的执行结果是( )。 public class Test1 { public static void main(String args []) { float t=0f; int q=5; System. out. println((t++)*(--q)); } }A.40B.40C.36D.36

考题 程序: class TestApp{ public static void main (String[] args){ int x=6; if (xl) System. out. println("xl"); else if (x5) System. out .println("x5"); else if (x10) System. out. println("xA、x5B、xlC、x10D、x29

考题 现有: class TestApp{ public static void main (String[] args){ int [5] myarray={ 10, 11, 12, 13, 14); int sum=0; for (int x : myarray) sum+=x; System. out. println( "sum= "+sum); } } 上述程序运行后的结果是哪项?()A、sum=10B、sum=70C、sum=60D、运行时抛出异常

考题 程序:  class    TestApp{  public  static void main (String[]  args){      int X=5:      switch (x){     case l:      case 2:      case 3:  System. out.println(“一季度”);      break;      case 4:      case 5: case 6:  System. out.println(“二季度”);     break;      default:  System. out.println(“三季度以上”);     break;     }     }     }  上述程序运行后的结果是哪项?()     A、 一季度B、二季度C、三季度以上D、无输出

考题 程序:  class   TestApp{  public  static  void main (String[]  args){     int x=6;     if (xl)  System. out. println("xl");     else if (x5)  System. out .println("x5");     else if (x10)  System. out. println("xSystem. out .println( "x29");     else  System. out.println(“以上都不是”);     }     }  上述程序运行后的结果是哪项?()      A、x5B、xlC、x10D、x29

考题 单选题程序:  class   TestApp{  public  static  void main (String[]  args){     int x=6;     if (xl)  System. out. println("xl");     else if (x5)  System. out .println("x5");     else if (xSystem. out .println( "xA x5B xlC x10D x29

考题 单选题现有: class TestApp{ public static void main (String[] args){ int [5] myarray={ 10, 11, 12, 13, 14); int sum=0; for (int x : myarray) sum+=x; System. out. println( "sum= "+sum); } } 上述程序运行后的结果是哪项?()A sum=10B sum=70C sum=60D 运行时抛出异常

考题 单选题程序:  class    TestApp{  public  static void main (String[]  args){      int X=5:      switch (x){     case l:      case 2:      case 3:  System. out.println(“一季度”);      break;      case 4:      case 5: case 6:  System. out.println(“二季度”);     break;      default:  System. out.println(“三季度以上”);     break;     }     }     }  上述程序运行后的结果是哪项?()A  一季度B 二季度C 三季度以上D 无输出