z = 42
z = 44
z = 45
z = 46
第1题:
A.6
B.7
C.8
D.10
第2题:
A.7
B.8
C.10
D.12
第3题:
A.Z=42
B.z=44
C.Z=45
D.z=46
第4题:
写出执行完下列代码段之后指定变量的值:
bool x=true ,y=false,z=false;
x=x&&y||z;
y=x||y&&z;
z=!(x!=y)||(y==z);
则x=false,y=【 】,z=【 】。
第5题:
现有: class Test2 f public static void main (String [] args) { boolean X= true; boolean y=false; short Z=20; if((x==true) && (y=true)) z++; if((y==true) || (++z==22)) z++; System. out .println( "z="+z); } 结果是什么?()
第6题:
class Foo { public static void main(String [] args) { int x = 0; int y = 4; for(int z=0; z 〈 3; z++, x++) { if(x 〉 1 & ++y 〈 10) y++; } System.out.println(y); } } 结果是什么?()
第7题:
public class Yikes { public static void go(Long n) {System.out.println(”Long “);} public static void go(Short n) {System.out.println(”Short “);} public static void go(int n) {System.out.println(”int “);} public static void main(String [] args) { short y= 6; long z= 7; go(y); go(z); } } What is the result?()
第8题:
public class Wow { public static void go(short n) {System.out.println(”short”); } public static void go(Short n) {System.out.println(”SHORT”);} public static void go(Long n) {System.out.println(” LONG”); } public static void main(String [] args) { Short y= 6; int z=7; go(y); go(z); } } What is the result?()
第9题:
Z=42
z=44
Z= 45
z= 46
第10题:
Z=21
Z=22
Z=23
Z= 24
第11题:
z=42
z=43
z=44
z=45
编译失败
运行的时候有异常抛出
第12题:
6
7
8
10
第13题:
A.z=42
B.z=44
C.z=45
D.z=46
第14题:
A.Z=21
B.Z=22
C.Z=23
D.Z=24
第15题:
执行下列代码段之后,变量z的值为______。 Public class Test8 { public static void main(String[] args) { int x=2; int y=3; int z=4; z-....= y-x--; System.out.println(z); }
A.1
B.2
C.3
D.4
第16题:
A. x=0,y=2,z=1
B. x=1,y=2,z=1
C. x=0,y=1,z=1
D. x=0,y=2,z=2
第17题:
现有: class Test4 { public static void main (String [] args) { boolean X=true; boolean y=false; short Z=42; if((z++==42) && (y=true))z++; if((x=false) || (++z==45)) z++; System. out.println(¨z=”+z); } } 结果为:()
第18题:
现有: class Foo { public static void main (String [] args) { int x=O; int y=4; for (int z=0; z<3; Z++; X++) { if(x>1&++y<10) y++; } System. out .println (y); } } 结果是什么?()
第19题:
class Test2{ public static void main(String [] args){ boolean x=true; boolean y=false; short z=42; if((x==true)&&y=true))z++; if((y==true||++z=44))z++; System.out.println(“z=”+z); } } 结果是什么?()
第20题:
class Test4 { public static void main(String [] args) { boolean x = true; boolean y = false; short z = 42; if((z++ = = 42) && (y = true)) z++; if((x = false) || (++z = = 45)) z++; System.out.println("z = " + z); } } 结果为:()
第21题:
int Long
Short Long
Compilation fails.
An exception is thrown at runtime.
第22题:
true
false
不确定
异常
第23题:
z = 42
z = 44
z = 45
z = 46
第24题:
short LONG
SHORT LONG
Compilation fails.
An exception is thrown at runtime.