单项选择题

下列程序执行之后,将输出 public class exl9 { public static void main(string[] args) { int x=3; int y=7; switch(y/x){ case 1: y*=2; break; case 2: y*=3; break; case 3: y*=4; break; default: y=0; } System.out.print(y); } }

A.28
B.21
C.14
D.0
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序的执行的结果是______。 public class ex8 { public static void main(String[] args) { double d=0; int a=3; while (a>0) { d=d+l. of a; if (d<=2) continue; a--; } System.out.println (d); } }
A.4.2
B.3.5
C.2.8
D.无限循环
单项选择题
编译和运行下列程序,请选择正确的输出结果______。 public class ex31 { private void test() { System.out.println(6 + 6 + (Result) ); } public static void main(String[] args) { new ex31().test(); } }
A.12(Resul
B.66(Reslll
C.编译时出错,运算符“+”不能实现一个string类型的数据和一个int类型数据的加法运算
D.运行时出错,运算符“+”不能将int类型数据转化为sbing类型
相关试题
  • 下列程序执行的结果是______。 publ...
  • 下列代码段在运行时会产生______异常...
  • 下列程序的执行结果是______。 publ...
  • 下列程序执行之后,输出的结果是_____...
  • 下列程序的输出结果是______。 publ...