单项选择题
有如下程序:
public class Sun
public static void main(String args[ ])
int s=0;
int i=1;
while(i<=100)
s=s+i;
System.out.println(s);
运行后的结果是( )。
A.5050
B.5051
C.死循环,直到溢出
D.无穷大的数
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
当执行下面代码时,会输出( )。 Boolean b1 = new Boolean(true); Boolean b2 = new Boolean(true); if (bl == b2) if (b1.equals(b2)) System.out.println( a ); else System.out.println( b ); else if (bi.equals(b2)) System.out.println( c ); else System.out.println( d );
A.a
B.b
C.c
D.d
点击查看答案&解析
单项选择题
下列代码段的执行结果为( )。 public class BitOperator public static void main(String args[ ]) int a=-67,b-116,c=78,d; d=~C>>2&(a|~B) ; System.out.println( d= +D) ;
A.d=70
B.d=67
C.d=78
D.d=116
点击查看答案&解析
相关试题
被用来向容器中添加构件的方法是( )。
编译Java Applet源程序文件产生的字节码文...
下列组件中能显示一个任务完成进度的是( )。
以下关于内部类的说明中不正确的是( )。
当使用流时,哪两种原始类型是可以互换的 ...