[单选题]

下面程序段的输出结果为( )。 publicclass Test { int a,b; Test() { a=100; b=200; } Test(intx,inty) { a=X; b=y; } publicstaticvoidmain(Stringargs[]) { TestObj1=newTest(12,45); System.out.println("a="+Obj1.a+" b="+Obj1.b); TestObj2=newTest(); System.out.println("a="+Obj2.a+"b="+Obj2.b); } }

A.a=100b=200 a=12 b=45

B.a=12 b=45 a=100b=200

C.a=12 b=200 a=100b=45

D.a=100b=45 a=12 b=200

参考答案与解析:

相关试题

下面程序段的输出结果为public class Test{int a,b;Tes

[单选题]下面程序段的输出结果为 public class Test { int a,b; Test() { a=100; b=200; } Test(int x,int y) { a=x; b=y; } public static void main(String args[]) { Test bjl=new Test(12,45); System.out.println("a="+objl.a+" b="+Objl.B); Test Obj2=new Test(); System.out.pr

  • 查看答案
  • 下面程序段的输出结果为public class Test{int a, b;Te

    [单选题]下面程序段的输出结果为 public class Test { int a, b; Test() { a=100; b=200; } Test(int x,int y) { a=x; b=y; } public static void main(String args[]) { Test Obj1=new Test(12,45); System.out.println("a=+Obj1.a+" b="+Obj1.B) ; Test Obj2=new Test(); System.out.p

  • 查看答案
  • 3下面程序段的输出结果为()。public class Test{int a,

    [单选题]3下面程序段的输出结果为( )。public class Test{ int a, b; Test() { a=100; b=200; } Test(int x, int y) { a=x; b=y; } public static void main(String args[]) { Test Obj 1 = new Test(12,45 ); System.out.println("a="+Obja+" b="+Objb); Test Obj2 = new Test(); Syste

  • 查看答案
  • 下面程序段的输出结果为package test;public class A {

    [单选题]下面程序段的输出结果为 package test; public class A { int x=20; static int y=6; public static void main(String args[]) { Class B b=new Class B(); b.go(10); System.out.println(”x=”+b.x); } } class Class B { int x; void go(int y) { ClassA a=new ClassA(); x=a.y; }

  • 查看答案
  • 下列程序段的输出结果是______。public class Test{int

    [单选题]下列程序段的输出结果是______。 public class Test{ int a,b; Test( ){ a=100; b=200; } Test(int x,int y){ a=X; b=y; } public static void main(String args[ ]){ Test Obj1=new Test(12,45); System.out.println("a="+Obj1.a+"b="+Obj1.B); Test Obj2=new Test( ); System.

  • 查看答案
  • 下面程序段的输出结果为package test;public class Cla

    [单选题]下面程序段的输出结果为 package test; public class ClassA { int x=20; static int y=6; public static void main(String args[]) { ClassB b=new ClassB(); b.go(10); System.out.println("x="+b.x); } } class ClassB { int x; void go(int y) { ClassA a=new ClassA(); x=a.

  • 查看答案
  • 下面程序段的输出结果为public class Test{public stat

    [单选题]下面程序段的输出结果为 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=fal

  • 查看答案
  • 下面程序段的输出结果为public class Test{public stat

    [单选题]下面程序段的输出结果为 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.printhln(”b=”+b+”c=”+c) ; } }A.a=true b=false b=true c=falseB.a=true b=false

  • 查看答案
  • 下面程序的输出结果为()。includef(int a){int b=0; st

    [主观题]下面程序的输出结果为()。includef(int a){int b=0; static int c=3; b£«£«; c£«£«; retu下面程序的输出结果为[ ]。include<iostream.h>f(int a){int b=0;static int c=3;b++; c++;return(a+ b+ c);}void main(){int a=2,i;for(i=0;i<3;i++)cout<<f(a)<<end1;}

  • 查看答案
  • 3下面程序段的输出结果为( )。mblic class Test public

    [单选题]3下面程序段的输出结果为( )。 mblic 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=fa

  • 查看答案
  • 下面程序段的输出结果为()。publicclass Test{int a,b;T