首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

下面程序段的输出结果为public class Test{int a,b;Test(){ a=100; b=200; } Test(int x,int y)

下面程序段的输出结果为 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=”+Obj 1.a+” b=”+Obj 1.b); Test Obj2=new Test(); System.out.println(”a=”+Obj 2.a+” b=”+Obj 2.b); } }

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

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

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

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

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“下面程序段的输出结果为public class Test{i…”相关的问题
第1题
下面程序段的输出结果为public class MyClass{public static void main(String args[]){String s

下面程序段的输出结果为 public class MyClass { public static void main(String args[]) { String s="Helto! How are you?"; System.out.println(s.lastlndexOf("o",16)); } }

A.16

B.o

C.u

D.17

点击查看答案
第2题
下面程序段的输出结果为package test;public class ClassA{int x=20;static int y=6;public stat

下面程序段的输出结果为 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.y; } }

A.x=10

B.x=20

C.x=6

D.编译不通过

点击查看答案
第3题
下面程序段的输出结果为package test;public class Class A{ int x=20; static int y=6; public

下面程序段的输出结果为 package test; public class 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 ClassB { int x; void go(int y) { ClassA a=new ClassA(); x=a.y; } }

A.x=10

B.x-20

C.x=6

D.编译不通过

点击查看答案
第4题
下面程序段的输出结果为()。pubUCClassTeS{public static voidmain(StringargS[]){booleaha,b,c;a

下面程序段的输出结果为()。 pubUCClassTeS { public static voidmain(StringargS[]) { booleaha,b,c; a=(3<5); b=(a==tme); System.Out.phntln("a="+a+"b="+b); c=(b==false); SyStem.out.println("b="+b+"C="+c); } }

A.a=tme b=falSe

B.a=true b=false b=true c=false b=true C=tme

C.a=true b=true

D.a=falSe b=false b=true c=falSe b=tme c=falSe

点击查看答案
第5题
3下面程序段的输出结果为()。mblic class Test public static void main(String args[]){boolean

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=false

B.a=true b=false b=true c=true

C.a=true b=true b=true c=false

D.a=false b=false b=true c=false

点击查看答案
第6题
3下面程序段的输出结果为()。public class Test{int a, b;Test(){ a=100; b=200;} Test(int x, in

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(); System.out.println("a="+Obja+" b="+Objb); }}

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

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

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

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

点击查看答案
第7题
下面代码段的输出结果为()。public class Test{public static void main(String sss[]){int i=0xF

下面代码段的输出结果为()。 public class Test { public static void main(String sss[]) { int i=0xFFFFFFFl; int j=~i; } }

A.0

B.1

C.14

D.-15

点击查看答案
第8题
执行下列程序段之后,输出的结果为______。public class ex43{ public static void main(String[]a

执行下列程序段之后,输出的结果为______。 public class ex43 { public static void main(String[] args) { short a=127; short b=4; a>>>=--b; System.out.println(a); } }

A.10

B.15

C.30

D.128

点击查看答案
第9题
下面程序输出的结果为()。include"iostream.h"classA{public:A(){cOUt<<"CLASSA

下面程序输出的结果为()。

include"iostream.h"

classA

{public:

A(){cOUt<<"CLASSA"<<endl;}

~A(){}};

ClaSSB:publicA

{public:

B(){cout<<"CLASSB"<<endl;}

~B(){}};

voidmain()

{A*P;

P=newB:

B*q:

q=newB;}

A.CLASSA

B.CLASSACLASSBCLASSBCLASSB

C.CLASSA

D.CLASSACLASSBCLASSBCLASSACLASSBCLASSBCLASSB

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改