题目内容 (请给出正确答案)
[单选题]

阅读下面的程序classPerson{undefinedstatic{undefinedSystem.out.println(“static”)}Person(){undefinedSystem.out.println(“构造”)}}classDemo{undefinedpublicstaticvoidmain(String[]args){undefinedPersonp=newPerson();}}下列关于程序运行结果的描述中,正确的是

A.输出:构造

B.输出:static构造

C.输出:static

D.没有输出结果

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“阅读下面的程序classPerson{undefinedst…”相关的问题

第1题

阅读下面的程序 main()

A.abc

B.a

C.c

D.程序语法出错

点击查看答案

第2题

请阅读下面的程序classTest/{privatestaticStringname;static/{name="World";System

请阅读下面的程序

classTest/{

privatestaticStringname;

static/{

name="World";

System.out.print(name);

/}

publicstaticvoidmain(String[]args)/{

System.out.print("Hello");

Testtest=newTest();

/}

/}

下列选项中,程序运行结果是()。

:A.World

B.Hello

C.World Hello

D.Hello World

点击查看答案

第3题

阅读下面的程序,该程序( ).main( ){ int a=5,b=0,c=0;if(a=b+c) printf("***/n");
阅读下面的程序,该程序().main(){ int a=5,b=0,c=0;if(a=b+c) printf("***/n");

阅读下面的程序,该程序().

main()

{ int a=5,b=0,c=0;

if(a=b+c) printf("***/n");

else printf("$$$/n"); }

A、可以通过编译但不能通过连接

B、输出***

C、输出$$$

D、有语法错不能通过编译

点击查看答案

第4题

请阅读下面的程序 下列选项中,哪一个是程序运行后count的值()

A.322

B.323

C.324

D.325

点击查看答案

第5题

请阅读下面的程序,选择正确的运行结果。()classDemo{undefinedprivatestaticintx;publicstaticvoidmain(String[]args){undefinedSystem.out.println(x++);}}

A.0

B.1

C.无结果

D.编译失败

点击查看答案

第6题

阅读下列文字,判断下面的观点是否正确 : ()
点击查看答案

第7题

阅读下面的代码publicclassExample{undefinedpublicstaticvoidmain(String[]args){undefinedStrings1=newString(“abc”);Strings2=s1.intern();Strings3=“abc”;System.out.println(s1==s2);System.out.println(s2==s3);System.out.println(s1==s3);}}程序的输出结果是()。

A.falsetruefalse

B.falsetruetrue

C.falsefalsetrue

D.truetruefalse

点击查看答案

第8题

阅读下面的代码:classPerson{undefinedvoidsay(){undefinedSystem.out.println(“hello”);}}classExample{undefinedpublicstaticvoidmain(String[]args){undefinedPersonp1=newPerson();Personp2=newPerson();p2.say();p1.say();p2=null;p2.say();}}下列选项中,哪个是程序的输出结果?()

A.hello

B.hellohello

C.hellohellohello

D.hellohello抛出异常

点击查看答案

第9题

请阅读下面的程序,程序的运行结果是()。classPerson{undefinedStringname;intage;publicPerson(){}publicPerson(Stringn,inta){undefinedname=n;age=a;}publicvoidshow(){undefinedSystem.out.print(name+“—”+age+"");}}publicclassTest{undefinedpublicstaticvoidmain(String[]args){undefinedPersonp1=newPerson();p1.show();Personp2=newPerson(“周星驰”,27);p2.show();}}

A.null—0周星驰—27

B.null—27周星驰—27

C.周星驰—0null—27

D.周星驰—27null—27

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信