SCJP题库 带达内考点分析②.pdf

SCJP题库 带达内考点分析②.pdf

ID:52297170

大小:418.33 KB

页数:27页

时间:2020-03-26

SCJP题库 带达内考点分析②.pdf_第1页
SCJP题库 带达内考点分析②.pdf_第2页
SCJP题库 带达内考点分析②.pdf_第3页
SCJP题库 带达内考点分析②.pdf_第4页
SCJP题库 带达内考点分析②.pdf_第5页
资源描述:

《SCJP题库 带达内考点分析②.pdf》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Module2-类、接口以及枚举一、选择题:Question1Given:11.publicinterfaceStatus{12./*insertcodehere*/intMY_VALUE=10;13.}Whichthreearevalidonline12?(Choosethree.)A.finalB.staticC.nativeD.publicE.privateF.abstractG.protectedQuestion2Given:10.classFoo{11.staticvoidalpha(){/*morecodehere*/}12.voidbeta(){/*morecodehere*

2、/}13.}Whichtwoaretrue?(Choosetwo.)A.Foo.beta()isavalidinvocationofbeta().B.Foo.alpha()isavalidinvocationofalpha().C.Methodbeta()candirectlycallmethodalpha().D.Methodalpha()candirectlycallmethodbeta().Question3ClicktheExhibitbutton.11.classPayload{12.privateintweight;13.publicPayload(intwt){weight=

3、wt;}14.publicPayload(){}15.publicvoidsetWeight(mtw){weight=w;}16.publicStringtoString{returnInteger.toString(weight);}17.}18.19.publicclassTestPayload{20.staticvoidchangePayload(Payloadp){21./*insertcodehere*/CopyrightTarenaCorporation,2008.Allrightsreserved22.}23.24.publicstaticvoidmain(String[]a

4、rgs){25.Payloadp=newPayload();26.p.setWeight(1024);27.changePayload(p);28.System.out.println("Thevalueofpis"+p);29.}30.}Whichstatement,placedatline21,causesthecodetoprint“Thevalueofpis420.”?A.p.setWeight(420);B.p.changePayload(420);C.p=newPayload(420);D.Payload.setWeight(420);E.p=Payload.setWeight

5、(420);F.p=newPayload();p.setWeight(420);Question4ClicktheExhibitbutton.1.publicclassItem{2.privateStringdesc;3.publicStringgetDescription(){returndesc;}4.publicvoidsetDescription(Stringd){desc=d;}5.6.publicstaticvoidmodifyDesc(Itemitem,Stringdesc){7.item=newItem();8.item.setDescription(desc);9.}10

6、.publicstaticvoidmain(String[]args){11.Itemit=newItem();12.it.setDescription("Gobstopper");13.Itemit2=newItem();14.it2.setDescription("Fizzylifting");15.modifyDesc(it,"Scrumdiddlyumptious");16.System.out.println(it.getDescription());17.System.out.println(it2.getDescription());18.}19.}Whatistheoutc

7、omeofthecode?A.Compilationfails.B.GobstopperFizzyliftingCopyrightTarenaCorporation,2008.AllrightsreservedC.GobstopperScrumdiddlyumptiousD.ScrumdiddlyumptiousFizzylifltngE.ScrumdiddlyumptiousScrumdiddlyumptiousQue

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。