欢迎来到天天文库
浏览记录
ID:31631272
大小:101.48 KB
页数:19页
时间:2019-01-16
《java双语教学考试试a卷及答案》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、注意事项:请将各题答案按编号顺序填写到答题卷上,答在试卷上无效。-、单项选择题(1~20每小题1分,21*30每小题2分,共40分)I2.WhicharekeywordsinJava?A.NullB・TRUEConsiderthefollowingcode:Integers=newInteger(9);Integert=newInteger(9);Longu=newLong(9);Whichtestwouldreturntrue?A.(s.equals(newInteger(9))C.(s==u)C.sizeofB.(s
2、.equals(9))D.(s==t)D.implementsWhichstatementofassigningalongtypevariabletoahexadecimalvalueiscorrect?0
3、Pg'曲4.unI5.A.longnumber=345L;B.longnumber=0345;C.longnumber=0345L;D.longnumber=0x345L;Whichlayoutmanagerisusedwhentheframeisresizedthebuttons'spositionintheFra
4、memightbechanged?A.BorderLayoutB.FlowLayoutC.CardLayoutD.GridLayoutWhicharenotJavaprimitivetypes?A.shortB.BooleanC.byteD.floatGiventhefollowingcode:if(x>0){System.out.println("firstn);}elseif(x>-3){System.out.println(MsecondH);}else{System.out.println(MthirdH);}W
5、hichrangeofxvaluewouldprintthestringusecond11?A.x>0B.x>-3C.x<=-3D.x<=0&x>-37.Giventhefollowingcode:publicclassPerson{intarr
6、
7、=newint
8、10];publicstaticvoidmain(Stringa
9、]){System.out.println(arr
10、11);Whichstatementiscorrect?A.Whencompilationsomeerrorwilloccur.B・Itisc
11、orrectwhencompilationbutwillcauseerrorwhenrunning.C.Theoutputiszero.D.Theoutputisnull.7.Shortanswer:Thedecimalvalueofiis13,theoctalivalueis:A.14B.015C.0x14D.0128.ApublicmembervairablecalledMAX_LENGTHwhichisinttype,thevalueofthevariableremainsconstantvalue100.Usea
12、shortstatementtodefinethevariable.A.publicintMAX_LENGTH=100;B.finalintMAX_LENGTH=100;C.finalpublicintMAX_LENGTH=100;D.publicfinalintMAX_LENGTH=100.9.WhichcorrectlycreateanarrayoffiveemptyStrings?A.Stringa[]=f"};B.Stringa[5];C.String[5]a;D.String[]a=newString[5];f
13、or(inti=0;i<5;a[i++]=null);11.Giventhefollowingmethodbody:{if(sometest()){unsafe();}else{safe();}}Themethod"unsafe”mightthrowanIOException(whichisnotasubclassofRunTimeException).Whichcorrectlycompletesthemethodofdeclarationwhenaddedatlineone?A.publicvoidmethodNam
14、e()throwsExceptionB・publicvoidmethodname()C.publicvoidmethodName()throwIOExceptionD.publicIOExceptionmethodName()12.Whatwouldbetheresultofattemptingtocompilean
此文档下载收益归作者所有