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 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=42
- B、 z=43
- C、z=44
- D、 z=45
- E、编译失败
- F、运行的时候有异常抛出
相关考题:
以下程序的运行结果为( )。 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
执行完下列代码段之后: bool x=true, y=false, z=false; x=xy‖z; y=x‖yz; z=!(x!=y)‖(y-z); 则x=false, y=false, Z=( )。A.trueB.falseC.不确定D.异常
阅读下面程序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
写出执行完下列代码段之后指定变量的值:boo1 x=true,y=false,z=false;x=xy‖z;y=x‖yz;z=!(x!=y)‖(y==z),则 x=false, y=false, z=【 】。
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.运行的时候有异常抛出
classFoo{publicstaticvoidmain(String[]args){intx=0;inty=4;for(intz=0;z〈3;z++,x++){if(x〉1++y〈10)y++;}System.out.println(y);}}结果是什么?() A.6B.7C.8D.10
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
现有: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
下面程序的结果【】。 include int f(int); void main() { int x=1,i; for (i=0; i 下面程序的结果【 】。include<iostream.h>int f(int);void main() {int x=1, i;for (i=0; i<3; i++)cout<<f(x)<<‘ ’ ;cout<<end1;}int f(int x){int y=1;static int z=3y++;z++;return (x+y+z);}
执行下列代码段之后,变量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
写出执行完下列代码段之后指定变量的值:bool x=true ,y=false,z=false;x=xy||z;y=x||yz;z=!(x!=y)||(y==z);则x=false,y=【 】,z=【 】。
以下程序的输出结果为:public class test {public static void main(String args[]) {int x=1,y=1,z=1;if (x--==1}} A. x=0,y=2,z=1B. x=1,y=2,z=1C. x=0,y=1,z=1D. x=0,y=2,z=2
现有: 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 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.
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
import java.io.PrintWriter; class DoFormat { public static void main(String [] args) { int x = 42; int y = 12345; float z = 7; System.out.format("-%4d- ", x); System.out.format("-%4d- ", y); System.out.format("-%4.1d- ", z); } } 结果为:() A、编译失败B、-42- -1234- -7.0-C、- 42- -1234- - 7.0-D、运行时异常被抛出
单选题现有: 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); } 结果是什么?()AZ=21BZ=22CZ=23DZ= 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=43Cz=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); } } 结果为:()Az = 42Bz = 44Cz = 45Dz = 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); } } 结果是什么?()A7B8C10D12
单选题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.