[单选题]

已知如下代码: switch(m) { case 0: System.out.println("Condition0"); case 1: System.out.println("Condition 1"); case 2: System.out.println("Condition 2"); case 3: System.out.println("Condition 3"); break; default: System.out.println("Other cCndition"); } 当m为( )时,"Condition 2"会出现在输出结果中。

A.2

B.0、1

C.0、1、2

D.0、1、2、3

参考答案与解析:

相关试题

已知如下代码:switch(m) {case 0: System. out. p

[单选题]已知如下代码: switch(m) { case 0: System. out. println("Condition 0 "); case 1: System. out. println("Condition 1 "); case 2: System. out. println("Condition 2 "); case 3: System. out. println("Condition 3 "); break; default: System. out. println(

  • 查看答案
  • 已知如下代码:booleanm=true;if(m=false)System.o

    [单选题]已知如下代码:booleanm=true;if(m=false)System.out.println("False");elseSystem.out.println("True");执行结果是()A . FalseB . TrueC . NoneD . 出错

  • 查看答案
  • 执行下列语句后,屏幕上显示I值为()。ihti=8;System.out.pri

    [单选题]执行下列语句后,屏幕上显示I值为()。ihti=8;System.out.println(i>>=2);A.8B.2C.10D.100000

  • 查看答案
  • 已知如下代码: boolean m=true; if(m==false) Sys

    [单选题]已知如下代码: boolean m=true; if(m==false) System.out.prinfln("False"); else System.out.println("True");A.假B.真C.NoneD.An error will occur when running

  • 查看答案
  • 已知如下代码: booleanm=tree; if(m==false) Syst

    [单选题]已知如下代码: boolean m=tree; if(m==false) System.out.println("False"); else System.out.pfintln("True"); 执行结果是( )。A.FalseB.TrueC.无结果D.运行时出错

  • 查看答案
  • ( 18 )阅读下面代码if(x==0){System.out.println(

    [单选题]( 18 )阅读下面代码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

  • 查看答案
  • 执行下面代码结果( )for(inti=0;;){System.out.prin

    [单选题]执行下面代码结果( )for(inti=0;;){System.out.println("这是"+i);break;}A.语法错误,缺少表达式2和表达式3B.死循环C.程序什么都不输出D.输出:这是0

  • 查看答案
  • 执行下面代码结果()for(inti=0;;){System.out.print

    [单选题]执行下面代码结果()for(inti=0;;){System.out.println("这是"+i);break;}A . 语法错误,缺少表达式2和表达式3B . 死循环C . 程序什么都不输出D . 输出:这是0

  • 查看答案
  • 已知如下代码:public class Testlong a[]=new lon

    [单选题]已知如下代码: public class Test long a[]=new long[10] public static void main (String args[]{ System.out.println(a[6];} 以下( )语句是正确的。A.Output is null.B.When running,some error will occur.C.When compile,some error will occur.D.Output is 0.

  • 查看答案
  • 阅读下面代码if(x= =0){System.out.println("冠军")

    [单选题]阅读下面代码if(x= =0){System.out.println("冠军");)elseif(x>一3){System.Out.println("亚军");}else{System.out.println("季军");}若要求打印字符串”季军”,则变量X的取值范围是( )。A.x=d&x<=-3B.x>OC.x>-3D.x<=-3

  • 查看答案
  • 已知如下代码:switch(m) {case 0: System.out.pri