单项选择题

下列程序的执行的结果是______。 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类型
单项选择题
下列程序执行后,输出的结果是______。 public class exl7 { public static void main(String[] args) int a=3; int b=4; int x=5; if(++a<b) x=x+a; else if(a--<-b) x-x-a; System.cut.print(x); } }
A.4
B.5
C.3
D.2
相关试题
  • 下列程序执行的结果是______。 publ...
  • 下列代码段在运行时会产生______异常...
  • 下列程序的执行结果是______。 publ...
  • 下列程序执行之后,输出的结果是_____...
  • 下列程序的输出结果是______。 publ...