欢迎来到天天文库
浏览记录
ID:243480
大小:86.24 KB
页数:18页
时间:2017-07-13
《JAVA双语教学考试试A卷及答案》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、班级学号姓名密封装订线密封装订线密封装订线A卷注意事项:请将各题答案按编号顺序填写到答题卷上,答在试卷上无效。一、单项选择题(1~20每小题1分,21~30每小题2分,共40分)1.WhicharekeywordsinJava?A.NullB.TRUEC.sizeofD.implements2.Considerthefollowingcode:Integers=newInteger(9);Integert=newInteger(9);Longu=newLong(9);Whichtestwouldreturntrue?A.(s.equals(newInteger(9))B.(s.e
2、quals(9))C.(s==u)D.(s==t)3.Whichstatementofassigningalongtypevariabletoahexadecimalvalueiscorrect?A.longnumber=345L; B.longnumber=0345;C.longnumber=0345L;D.longnumber=0x345L;4.Whichlayoutmanagerisusedwhentheframeisresizedthebuttons'spositionintheFramemightbechanged?A.BorderLayout B.FlowLayo
3、ut C.CardLayout D.GridLayout5.WhicharenotJavaprimitivetypes?A.short B.Boolean C.byte D.float6.Giventhefollowingcode: if(x>0){System.out.println("first");} elseif(x>-3){System.out.println("second");} else{System.out.println("third");}Whichrangeofxvaluewouldprintthestring"second"? A.x>
4、0 B.x>-3 C.x<=-3 D.x<=0&x>-37.Giventhefollowingcode:publicclassPerson{intarr[]=newint[10];publicstaticvoidmain(Stringa[]){ System.out.println(arr[1]); }}面向对象程序设计(JAVA)第18页共18页Whichstatementiscorrect?A.Whencompilationsomeerrorwilloccur.B.Itiscorrectwhencompilationbutwillcauseerrorwhenrunn
5、ing.C.Theoutputiszero.D.Theoutputisnull.1.Shortanswer:Thedecimalvalueofiis13,theoctalivalueis:A.14B.015C.0x14D.0122.ApublicmembervairablecalledMAX_LENGTHwhichisinttype,thevalueofthevariableremainsconstantvalue100.Useashortstatementtodefinethevariable.A.publicintMAX_LENGTH=100; B.finalintMAX_
6、LENGTH=100;C.finalpublicintMAX_LENGTH=100; D.publicfinalintMAX_LENGTH=100.3.WhichcorrectlycreateanarrayoffiveemptyStrings?A.Stringa[]={"","","","","",""};B.Stringa[5];C.String[5]a;D.String[]a=newString[5];for(inti=0;i<5;a[i++]=null);4.Giventhefollowingmethodbody:{if(sometest()){unsafe();}else
7、{safe();}}Themethod"unsafe"mightthrowanIOException(whichisnotasubclassofRunTimeException).Whichcorrectlycompletesthemethodofdeclarationwhenaddedatlineone?A.publicvoidmethodName()throwsExceptionB.publicvoidmethodname()C.publicvoidmethodName()t
此文档下载收益归作者所有