SCJP认证考试题集.doc

SCJP认证考试题集.doc

ID:55632193

大小:346.50 KB

页数:105页

时间:2020-05-21

SCJP认证考试题集.doc_第1页
SCJP认证考试题集.doc_第2页
SCJP认证考试题集.doc_第3页
SCJP认证考试题集.doc_第4页
SCJP认证考试题集.doc_第5页
资源描述:

《SCJP认证考试题集.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、310-055SCJIP认证考试题集Question1Given:11.publicinterfaceStatus{12./*insertcodehere*/intMY_VALUE=10;13.}Whichthreearevalidonline12?(Choosethree.)A.finalB.staticC.nativeD.publicE.privateF.abstractG.protectedAnswer:ABDQuestion2Given:10.publicclassBar{11.staticvoidfoo(int...x){12.//insertcodehere13.}14.}Wh

2、ichtwocodefragments,insertedindependentlyatline12,willallowtheclasstocompile?(Choosetwo.)A.foreach(x)System.out.println(z);B.for(intz:x)System.out.println(z);abcdC.while(x.hasNext())System.out.println(x.next());D.for(inti=0;i

3、lassTest{12.publicstaticvoidmain(String[]args){13.intx=5;14.booleanb1=true;15.booleanb2=false;16.17.if((x==4)&&!b2)18.System.out.print(”l“);19.System.out.print(”2“);20.if((b2=true)&&b1)21.System.out.print(”3“);22.}23.}Whatistheresult?A.2B.3C.12D.23E.123F.Compilationfails.G.Auexceptionalisthrownatr

4、untime.Answer:DQuestion44.Given:31.//somecodehere32.try{33.//somecodehere34.}catch(SomeExceptionse){35.//somecodehere36.}finally{37.//somecodehere38.}Underwhichthreecircumstanceswillthecodeonline37beexecuted?(Choosethree.)A.Theinstancegetsgarbagecollected.B.Thecodeonline33throwsanexception.C.Theco

5、deonline35throwsanexception.D.Thecodeonline31throwsanexception.E.Thecodeonline33executessuccessfully.Answer:BCElQuestion5Given:10.interfaceFoo{}11.classAlphaimplementsFoo{}12.classBetaextendsAlpha{}13.classDeltaextendsBeta{14.publicstaticvoidmain(String[]args){15.Betax=newBeta();16.//insertcodeher

6、e17.}18.}Whichcode,insertedatline16,willcauseajava.lang.ClassCastException?A.Alphaa=x;B.Foof=(Delta)x;C.Foof=(Alpha)x;D.Betab=(Beta)(Alpha)x;Answer:BQuestion6Given:?disavalid,non-nullDateobject?dfisavalid,non-nullDateFormatobjectsettothecurrentlocaleWhatoutputsthecurrentlocalescountrynameandtheapp

7、ropriateversionofd’sdate?A.Localeloc=Locale.getLocale();System.out.println(loc.getDisplayCountry()+““+df.format(d));B.Localeloc=Locale.getDefault();System.out.println(loc.getDisplayCountry()+““+df.format(d));C.Lo

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

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

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