欢迎来到天天文库
浏览记录
ID:9159942
大小:160.42 KB
页数:18页
时间:2018-04-19
《《面向对象程序设计(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(new
2、Integer(9))B.(s.equals(9))C.(s==u)D.(s==t)3.Whichstatementofassigningalongtypevariabletoahexadecimalvalueiscorrect?A.longnumber=345L; B.longnumber=0345;C.longnumber=0345L;D.longnumber=0x345L;4.Whichlayoutmanagerisusedwhentheframeisresizedthebuttons'spositionintheFramemightbe
3、changed?A.BorderLayout B.FlowLayout 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");}W
4、hichrangeofxvaluewouldprintthestring"second"? A.x>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.Whencompilationsome
5、errorwilloccur.B.Itiscorrectwhencompilationbutwillcauseerrorwhenrunning.C.Theoutputiszero.D.Theoutputisnull.1.Shortanswer:Thedecimalvalueofiis13,theoctalivalueis:A.14B.015C.0x14D.0122.ApublicmembervairablecalledMAX_LENGTHwhichisinttype,thevalueofthevariableremainsconstantvalu
6、e100.Useashortstatementtodefinethevariable.A.publicintMAX_LENGTH=100; B.finalintMAX_LENGTH=100;C.finalpublicintMAX_LENGTH=100; D.publicfinalintMAX_LENGTH=100.3.WhichcorrectlycreateanarrayoffiveemptyStrings?A.Stringa[]={"","","","","",""};B.Stringa[5];C.String[5]a;D.String[]a
7、=newString[5];for(inti=0;i<5;a[i++]=null);4.Giventhefollowingmethodbody:{if(sometest()){unsafe();}else{safe();}}Themethod"unsafe"mightthrowanIOException(whichisnotasubclassofRunTimeException).Whichcorrectlycompletesthemethodofdeclarationwhenaddedatlineone?A.publicvoidmethodNa
8、me()throwsExceptionB.publicvoidmethodname()C.publicvoidmethodName()t
此文档下载收益归作者所有