java程序员认证模拟题及详细分析

java程序员认证模拟题及详细分析

ID:19862543

大小:69.50 KB

页数:24页

时间:2018-10-07

java程序员认证模拟题及详细分析_第1页
java程序员认证模拟题及详细分析_第2页
java程序员认证模拟题及详细分析_第3页
java程序员认证模拟题及详细分析_第4页
java程序员认证模拟题及详细分析_第5页
资源描述:

《java程序员认证模拟题及详细分析》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Java程序员认证模拟题及详细分析二.模拟题1.Whichstatementaboutthegarbagecollectionmechanismaretrue?A.Garbagecollectionrequireadditionalprogramecodeincaseswheremultiplethreadsarerunning.B.Theprogrammercanindicatethatareferencethroughalocalvariableisnolongerofinterest.C.Theprogrammerha

2、samechanismthatexplicityandimmediatelyfreesthememoryusedbyJavaobjects.D.ThegarbagecollectionmechanismcanfreethememoryusedbyJavaObjectatexplectiontime.E.Thegarbagecollectionsystemneverreclaimsmemoryfromobjectswhilearestillaccessibletorunninguserthreads.2.Givethefoll

3、owingmethod:1)publicvoidmethod(){2)Stringa,b;3)a=newString(“helloworld”);4)b=newString(“gameover”);5)System.out.println(a+b+”ok”);6)a=null;7)a=b;8)System.out.println(a);9)}Intheabsenceofcompileroptimization,whichistheearliestpointtheobjectareferedisdefinitelyelibil

4、etobegarbagecollection.A.beforeline3B.beforeline5C.beforeline6D.beforeline7E.Beforeline93.Intheclassjava.awt.AWTEvent,whichistheparentclassuponwhichjdk1.1awteventsarebasedthereisamethodcalledgetIDwhichphraseaccuratelydescribesthereturnvalueofthismethod?A.Itisarefer

5、encetotheobjectdirectlyaffectedbythecauseoftheevent.B.Itisanindicationofthenatureofthecauseoftheevent.C.Itisanindicationofthepositionofthemousewhenitcausedtheevent.D.Inthecaseofamouseclick,itisanindicationofthetextunderthemouseatthetimeoftheevent.E.Ittellsthestateo

6、fcertainkeysonthekeybordatthetimeoftheevent.F.Itisanindicationofthetimeatwhichtheeventoccurred.4.Whichstatementaboutlisteneristrue?A.Mostcomponentallowmultiplelistenerstobeadded.B.Ifmultiplelistenerbeaddtoasinglecomponent,theeventonlyaffectedonelistener.C.Component

7、don?tallowmultiplelistenerstobeadd.D.ThelistenermechanismallowsyoutocallanaddXxxxListenermethodasmanytimesasisneeded,specifyingasmanydifferentlistenersasyourdesignrequire.5.Givethefollowingcode:publicclassExample{publicstaticvoidmain(Stringargs[]){intl=0;do{System.

8、out.println(“Doingitforlis:”+l);}while(--l>0)System.out.println(“Finish”);}}Whichwellbeoutput:A.Doingitforlis3B.Doingitforlis1C.Doingitforlis2D.D

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

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

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