网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
现有: 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 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=21B、Z=22C、Z=23D、Z= 24” 相关考题
考题
以下程序的运行结果为( )。 public class Sun { public static void main(String args[]) { String x="A",y="B",z="C"; for(int m=1;m<=2;m++) { x=y; y=z; z=x; } System.out.println(x+y+z); } }A.ABCB.BCAC.BCBD.CBC
考题
阅读下面程序public class Test3{public static void main(String args[]){int x=3,y=4,z=5;String s= " xyz " ;System.out.println(s+x+y+z);}}程序运行的结果是A)xyz12B)xyz345C)xyzxyzD)12xyz
考题
下面程序执行后,输出的结果是( )。 public class Test { public static void main (String[] )args) { boolean m=true; if(m==false) System.out.println("假"); else if(m====true) System.out.println("真"); else System.out.println ("错误"); } }A.真B.假C.错误D.编译出错
考题
classTest2{publicstaticvoidmain(String[]args){booleanx=true;booleany=false;shortz=42;if((x==true)y=true))z++;if((y==true||++z=44))z++;System.out.println(z=”+z);}}结果是什么?()
A.z=42B.z=43C.z=44D.z=45E.编译失败F.运行的时候有异常抛出
考题
classTest4{publicstaticvoidmain(String[]args){booleanx=true;booleany=false;shortz=42;if((z++==42)(y=true))z++;if((x=false)||(++z==45))z++;System.out.println(z=+z);}}结果为:()
A.z=42B.z=44C.z=45D.z=46
考题
现有:classFoo{publicstaticvoidmain(String[]args){intx=O;inty=4;for(intz=0;z3;Z++;X++){if(x1++y10)y++;}System.out.println(y);}}结果是什么?()
A.7B.8C.10D.12
考题
现有:classTest2fpublicstaticvoidmain(String[]args){booleanX=true;booleany=false;shortZ=20;if((x==true)if((y==true)||(++z==22))z++;System.out.println(z=+z);}结果是什么?()
A.Z=21B.Z=22C.Z=23D.Z=24
考题
现有:classTest4{publicstaticvoidmain(String[]args){booleanX=true;booleany=false;shortZ=42;if((z++==42)if((x=false)||(++z==45))z++;System.out.println(z=”+z);}}结果为:()
A.Z=42B.z=44C.Z=45D.z=46
考题
执行下列代码段之后,变量b的值为______。 public class ex40 { public static void main(String[] args) { byte x=5; byte y=5; byte c=10; boolean b; b-c<x<<y; System.out.println (b); } }A.1B.0C.falseD.true
考题
下列语句输出结果为( )。 public class test { public static void main (String args[]) { int x=10,y=9; boolean b=true; System.out.println(x<y||!b); } }A.真B.假C.1D.0
考题
执行下列代码段之后,变量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.1B.2C.3D.4
考题
阅读下面程序 public class Test3 { public static void main(String[] args) { int x=3,y=4,z=5; String s="xyz": System.out.println(s+x+y+z); } } 程序运行的结果是A.xyz12B.xyz345C.xyzxyzD.12xyz
考题
下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.println("a="+a+"b="+B); c=(b==false); System.out.println("b="+b+"c="+C); } }A.a=true b=false b=true c=falseB.a=true b=false b=true c=trueC.a=true b=true b=true c=falseD.a=false b=false b=true c=false
考题
下列语句输出结果为( )。 public class test { public static void main(String args[ ]) { int x=10,y=8; boolean b=true; System.out.println(x>0&&x<y||b); } }A.真B.假C.1D.0
考题
现有: 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); } } 结果为:() A、 Z=42B、 z=44C、 Z= 45D、 z= 46
考题
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); } } 结果是什么?() A、6B、7C、8D、10
考题
现有: class Foo { public static void main (String [] args) { int x=O; int y=4; for (int z=0; z3; Z++; X++) { if(x1++y10) y++; } System. out .println (y); } } 结果是什么?() A、7B、8C、10D、12
考题
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?() A、 int LongB、 Short LongC、 Compilation fails.D、 An exception is thrown at runtime.
考题
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); } } 结果是什么?() A、 z=42B、 z=43C、z=44D、 z=45E、编译失败F、运行的时候有异常抛出
考题
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?() A、 short LONGB、 SHORT LONGC、 Compilation fails.D、 An exception is thrown at runtime.
考题
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); } } 结果为:() A、z = 42B、z = 44C、z = 45D、z = 46
考题
单选题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?()A
int LongB
Short LongC
Compilation fails.D
An exception is thrown at runtime.
考题
单选题现有: 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=21B
Z=22C
Z=23D
Z= 24
考题
单选题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); } } 结果是什么?()A
z=42B
z=43C
z=44D
z=45E
编译失败F
运行的时候有异常抛出
考题
单选题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); } } 结果为:()A
z = 42B
z = 44C
z = 45D
z = 46
考题
单选题现有: class Foo { public static void main (String [] args) { int x=O; int y=4; for (int z=0; z1++y10) y++; } System. out .println (y); } } 结果是什么?()A
7B
8C
10D
12
考题
单选题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?()A
short LONGB
SHORT LONGC
Compilation fails.D
An exception is thrown at runtime.
热门标签
最新试卷