A-A+

下列程序段的输出结果为__________。 int a=2; switch (a) { c

2022-08-12 19:52:52 问答库 阅读 197 次

问题详情

下列程序段的输出结果为__________。 int a=2; switch (a) { case2: System.out.print("Value is2."); case3: System.out.pritln("Value is3."); break; default: System.out.println("end"); break: }


请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:Value is 2.Value is 3.
Valueis2.Valueis3.

考点:结果,程序