单项选择题
现有:
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);
}
结果是什么?()
A.Z=21
B.Z=22
C.Z=23
D.Z= 24
点击查看答案&解析
相关考题
-
单项选择题
现有: class WhileTests { public static void main (String [] args) { int X=5; while (++x<4) { --x; } System.out.println( "x="+x); } } 结果是什么?()
A.X=6
B.X=5
C.X=2
D.编译失败 -
单项选择题
以下哪种初始化数组的方式是错误的?()
A. String[]names={"zhang", "wang", "li");
B. String names[] =new String [3];names [0] ="zhang"; names [1] ="wang"; names [2] ="li";
C. String[3] names={"zhang", "wang", "li"};
D. 以上皆正确 -
单项选择题
现有: class Output { public static void main (String[] args) { int i=5: System.out.print( "4"+i+""); System.out.print (i+5+"7"); System.out.println (i+"8"); } } 结果为:()
A. 99722
B. 955758
C. 4510758
D. 459722
