网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
Given the following code: if (x>0) { System.out.println("first"); } else if (x>-3) { System.out.println("second"); } else { System.out.println("third"); } Which range of x value would print the string "second"?()
- A、 x > 0
- B、 x > -3
- C、 x <= -3
- D、 x <= 0 & x > -3
参考答案
更多 “ Given the following code: if (x0) { System.out.println("first"); } else if (x-3) { System.out.println("second"); } else { System.out.println("third"); } Which range of x value would print the string "second"?() A、 x 0B、 x -3C、 x = -3D、 x = 0 x -3” 相关考题
考题
下列代码中if(xO){System.out.println(first);}elseif(x-3){System.out.println(second);)else{System.out.println(third);)要求打印字符串为“second”时,X的取值范围是( )。A.x-3B.x>0C.x>-3D.x
考题
下列代码中if(x>0){System.out.println("first");} else if(x>-3)(System.out.println("second");} else{ System.out.println("third");}要求打印字符串为"second"时,x的取值范围是A.x<=0 并且 x>-3B.x>0C.x>-3D.x<=-3
考题
下面程序段的输出结果是( )。 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+(int)Math.random()*3/2; if (x>y) System.out.println("x>y"); else if (x==y) System.out.println("x=y"); else System.out.println("x<y"); } }A.x>yB.x=yC.x<yD.编译错误
考题
运行下面程序后,正确的输出结粜是( )。 public class Sun { public static void main(String args[]) { int x=6; if(x>6) System.out.printin("x>6"); else if(x<8) System.out.println("X<8"); else if(x==6) System.out.println("x=6"); } }A.x<8x=6B.x<8C.x=6D.x<8或x=6
考题
( 18 )阅读下面代码if(x==0){System.out.println(" 冠军 ");}else if (x-3){System.out.println(" 亚军 ");}else { System.out.println(" 季军 ");}若要求打印字符串 “ 季军 ” ,则变量 x 的取值范围是A ) x=0 x=-3B ) x0C ) x-3D ) x=-3
考题
给出下面程序段if(x>0){System.out.println“Hello.“;}elseif(x>-3){System.out.println“Nicetomeetyou“;}else{System.out.println“Howareyou“;}若打印字符串“Howareyou”,则x的取值范围是()。
A.x>0B.x>-3C.xD.x-3
考题
classBeta{publicstaticvoidmain(String[]args){Integerx=newInteger(6)*7;if(x!=42){System.out.print(42);}elseif(x〈newInteger(44-1)){System.out.println(less);}else{System.out.print(done);}}}结果是什么?()A.lessB.42C.doneD.编译失败
考题
Giventhefollowingcode:if(x0){System.out.println(first);}elseif(x-3){System.out.println(second);}else{System.out.println(third);}Whichrangeofxvaluewouldprintthestringsecond?()A.x0B.x-3C.x=-3D.x=0x-3
考题
有如下程序段: if(x>0){ System.out. println("first");} else if(x>-4){ System.out.println("second");} else { System.out.println("third");}x的取值在什么范围内时,将打印出字符串 "second" ?A.x>0B.x>-4C.x<= -4D.x<= 0x> -4
考题
给出下面程序段: if(x>0){System.out.println("Hello.");} else if(x>-3){ System.out.println("Nice to meet you!");} else{System.out.println("How are you?");} 若打印字符串"How are yoh?",则x的取值范围是( )。A.x>0B.x>-3C.x≤-3D.x≤0x>-3
考题
有如下程序段 if(x0) { System.out.println("first");} else if (x -4) { System.out.println("second");} else { System.out.println("third");} x的取值在什么范围内时,将打印出字符串“second"?A.x 0B.x -4C.x = -4D.x = 0 x -4
考题
阅读下面代码 if(x==0){System.out.println("冠军"); else if(x>-3){System.out.println(“亚军”);} else {System.out.println(“季军”);} 若要求打印字符串“季军”,则变量x的取值范围是A.x=0 x<=-3B.x>0C.x>-3D.x<=-3
考题
给出下面程序段 if(x0) System.out.println("Hello."); else if(x>-3) System.out.println("Nice to meet you!"); else System.out.println("How are you?"); 若打印字串"How are you?",则x的取值范围是( )。A.x>0B.x>-3C.x<=-3D.x<=0x>-3
考题
下列代码中 d(x>0)(System.out.Pdntln("first");} else if(x>-3){System.out.pnntln("second");} else{System.out.pdlldn("third");)要求打印字符串为"second"时,x的取值范围是( )。A.x<=0并且x>-3B.x>OC.x>-3D.x<=-3
考题
2给出下面代码段,x处于( )范围时打印字符串“second”。 pubhc class forLoopStatement{ public static voidmain(String[]args){ int x=______;//给x赋值 if(x>0) {System.out.println("second"); } else if(x>-3) {System.out.println("second"); } else { System.out.printlnCthird"); } } }A.x>0B.x>-3C.x<=-3D.x<=0 x>-3
考题
下列代码中 if(x>0){System.out.println("first");} elseif(x>-3){System.out.println("second");} else{System.out.println("third");} 要求打印字符串为"second"时,x的取值范围是( )。A.x<=0并且x>-3B.x>0C.x>-3D.x<=-3
考题
下面程序段的输出结果是______。 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)+(int)Math.random( )*3/2; if(x>y) System.out.println("x>y"); else if(x==y) System.out.println("x=y"); else System.out.println("x<y"); } }A.x>yB.x=yC.x<yD.编译错误
考题
阅读下面代码 if(x= =0){System.OUt.println("冠军");} elseif(x-3){System.OUt.println("亚军");) else{System.Out.println("季军");) 若要求打印字符串”季军”,则变量X的取值范围是( )。A.x=0x= -3B.x0C.x-3D.x=-3
考题
下列代码中 if(xO){System.out.println("first");} elseif(x-3){System.out.println("second");) else{System.out.println("third");) 要求打印字符串为“second”时,X的取值范围是( )。A.x=0且x-3B.x0C.x-3D.x=-3
考题
给出下列代码片段: if(x>0){System.out.println("first");} else if(x>-3){System.out.println("second");} else{System.out.println("third");} 当x处于( )范围时打印字符串"second"。A.x>0B.x>-3C.-3<x<=0D.x<=-3
考题
有如下程序段 if(x>0){System.out.println("first");} else if(x>-4){System.out.println("second");{ else{System.out.println("third");}x的取值在什么范围内时,将打印出字符串“second”? ( )A.x>0B.x>-4C.x<-4D.x<0x>-4
考题
给出下面代码段:x处于什么范围时打印字符串“second”。 ( ) public class forLoopStatement { public static void main(String[]args) { int x=______;//给x赋值 if(x>0){System.out.println("first");} else if(x>-3){System.out.println("second");} else{System.out.println("third");} } }A.x>0B.x>-3C.x<=-3D.x<=0x>-3
考题
class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x 〈 new Integer(44-1)) { System.out.println("less"); } else { System.out.print("done"); } } } 结果是什么?() A、lessB、42C、doneD、编译失败
考题
Given the following code fragment: 1) String str = null; 2) if ((str != null) (str.length() 10)) { 3) System.out.println("more than 10"); 4) } 5) else if ((str != null) (str.length() 5)) { 6) System.out.println("less than 5"); 7) } 8) else { System.out.println("end"); } Which line will cause error?() A、 line 1B、 line 2C、 line 5D、 line 8
考题
单选题Given the following code: if (x0) { System.out.println("first"); } else if (x-3) { System.out.println("second"); } else { System.out.println("third"); } Which range of x value would print the string "second"?()A
x 0B
x -3C
x = -3D
x = 0 x -3
考题
单选题Given the following code fragment: 1) String str = null; 2) if ((str != null) (str.length() 10)) { 3) System.out.println("more than 10"); 4) } 5) else if ((str != null) (str.length() 5)) { 6) System.out.println("less than 5"); 7) } 8) else { System.out.println("end"); } Which line will cause error?()A
line 1B
line 2C
line 5D
line 8
考题
单选题class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x 〈 new Integer(44-1)) { System.out.println("less"); } else { System.out.print("done"); } } } 结果是什么?()A
lessB
42C
doneD
编译失败
热门标签
最新试卷