欢迎来到天天文库
浏览记录
ID:37845503
大小:105.50 KB
页数:13页
时间:2019-06-01
《Java模拟题new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Java程序员认证模拟题(onlyfortrainning)一.说明:(真实考试)1.考试形式:网络计算机2.考题形式:多选,单选,简答3.题量:604.考试时间:120分钟二.模拟题1.Whichstatementaboutthegarbagecollectionmechanismaretrue?A.Garbagecollectionrequireadditionalprogramecodeincaseswheremultiplethreadsarerunning.B.Theprogrammercanindicatethatar
2、eferencethroughalocalvariableisnolongerofinterest.C.TheprogrammerhasamechanismthatexplicityandimmediatelyfreesthememoryusedbyJavaobjects.D.ThegarbagecollectionmechanismcanfreethememoryusedbyJavaObjectatexplectiontime.E.Thegarbagecollectionsystemneverreclaimsmemoryfrom
3、objectswhilearestillaccessibletorunninguserthreads.2.Givethefollowingmethod: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)}Intheabsenceofcompileroptimizati
4、on,whichistheearliestpointtheobjectareferedisdefinitelyelibiletobegarbagecollection.A.beforeline3B.beforeline5C.beforeline6D.beforeline7E.Beforeline93.Intheclassjava.awt.AWTEvent,whichistheparentclassuponwhichjdk1.1awteventsarebasedthereisamethodcalledgetIDwhichphrase
5、accuratelydescribesthereturnvalueofthismethod?A.Itisareferencetotheobjectdirectlyaffectedbythecauseoftheevent.B.Itisanindicationofthenatureofthecauseoftheevent.C.Itisanindicationofthepositionofthemousewhenitcausedtheevent.D.Inthecaseofamouseclick,itisanindicationofthe
6、textunderthemouseatthetimeoftheevent.E.Ittellsthestateofcertainkeysonthekeybordatthetimeoftheevent.F.Itisanindicationofthetimeatwhichtheeventoccurred.4.Whichstatementaboutlisteneristrue?A.Mostcomponentallowmultiplelistenerstobeadded.B.Ifmultiplelistenerbeaddtoasinglec
7、omponent,theeventonlyaffectedonelistener.C.Componentdon’tallowmultiplelistenerstobeadd.D.ThelistenermechanismallowsyoutocallanaddXxxxListenermethodasmanytimesasisneeded,specifyingasmanydifferentlistenersasyourdesignrequire.5.Givethefollowingcode:publicclassExample{pub
8、licstaticvoidmain(Stringargs[]){intl=0;do{System.out.println(“Doingitforlis:”+l);}while(--l>0)System.out.println(“Finish”);}
此文档下载收益归作者所有