《面向对象程序设计(JAVA)》英汉双语教学考试试卷A及答案

《面向对象程序设计(JAVA)》英汉双语教学考试试卷A及答案

ID:9159942

大小:160.42 KB

页数:18页

时间:2018-04-19

《面向对象程序设计(JAVA)》英汉双语教学考试试卷A及答案_第1页
《面向对象程序设计(JAVA)》英汉双语教学考试试卷A及答案_第2页
《面向对象程序设计(JAVA)》英汉双语教学考试试卷A及答案_第3页
《面向对象程序设计(JAVA)》英汉双语教学考试试卷A及答案_第4页
《面向对象程序设计(JAVA)》英汉双语教学考试试卷A及答案_第5页
资源描述:

《《面向对象程序设计(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

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

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

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