以下程序的计算结果是()。class Test { public static void main(String[] args){int d=5;intc
以下程序的计算结果是()。
class Test { public static void main(String[] args){int d=5;int
c=2;float x=d/c;System.out.println("x="+x);} }
以下程序的计算结果是()。
class Test { public static void main(String[] args){int d=5;int
c=2;float x=d/c;System.out.println("x="+x);} }
第1题
A.3,4,5
B.5,3,4
C.5,4,3
D.4,3,5
第2题
A.编译失败
B.编译通过,没有结果输出
C.输出:除法正常运行
D.输出:除数不能为0
第4题
A.import jav
B.awt.
C.package mypackage
D.class OtherClass{ }
E.public class MyClass{ }
第5题
A.85
B.33
C.0
D.7
第6题
A.小兰小翠
B.小凤小翠
C.小芳小翠
D.程序编译失败
第7题
A.31
B.10
C.20
D.13
第8题
A.2,-1
B.3,1
C.2,0
D.2,1
第9题
A.K=5
B.K=6
C.K=8
D.K=10
第10题
阅读以下程序,给出运行结果。
publicclassCase{
publicstaticvoidmain(Stringargs[]){
floatx=11;
floaty=4;
intz=(int)(x%y);
switch(z){
case1:
x=x+1;
case2:
x=x+2;
default:
x=x+3;
}
System.out.println(“Valueofxis:”+x);
}
}
运行结果是: