JAVA全英试卷

JAVA全英试卷

ID:37845135

大小:227.42 KB

页数:10页

时间:2019-06-01

JAVA全英试卷_第1页
JAVA全英试卷_第2页
JAVA全英试卷_第3页
JAVA全英试卷_第4页
JAVA全英试卷_第5页
资源描述:

《JAVA全英试卷》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、装订线华南农业大学期末考试试卷(A卷)2011-2012学年第2学期考试科目:面向对象程序设计考试类型:(闭卷)考试考试时间:120分钟学号姓名年级专业题号一二三四总分得分评阅人得分I.Singlechoice(60points)1.WhichofthefollowingstatementscompilesOK?A.String#name="JaneDoe";B.int$age=24;C.Double_height="123.5";D.double~temp=37.5;2.WhataretheextensionnamesofJavasourcefi

2、leandexecutablefile?A..javaand.exeB..jarand.classC..javaand.classD..jarand.exe3.Given:10.classCertKiller{11.staticvoidalpha(){/*morecodehere*/}12.voidbeta(){/*morecodehere*/}13.}Whichstatementiswrong?A.CertKiller.beta()isavalidinvocationofbeta()B.CertKiller.alpha()isavalidinvo

3、cationofalpha()C.Methodbeta()candirectlycallmethodalpha()D.Themethodbeta()canonlybecalledviareferencestoobjectsofCertKiller4.WhichmethodnamedoesnotfollowtheJavaBeansstandardonAccessor/Mutator?A.getSizeB.setCustC.notAvailableD.isReadable5.ReadthefollowingclassClassA,whichstatem

4、entiscorrectafterexecuting“newClassA().getValue();”publicclassClassA{publicintgetValue(){intvalue=0;booleansetting=true;Stringtitle="Hello";if(value

5、

6、(setting&&title=="Hello")){return1;}if(value==1&title.equals("Hello")){return2;}}}A.ThereiscompilationerrorforClassAB.Itoutputs

7、2C.Itoutputs1D.ExecutesOK,butnooutput9装订线1.Given:publicvoidtestIfA(){if(testIfB("true")){System.out.println("True");}else{System.out.println("Nottrue");}}publicBooleantestIfB(Stringstr){returnBoolean.valueOf(str);}WhatistheresultwhenmethodtestIfAisinvoked?A.TrueB.NottrueC.Anex

8、ceptionisthrownatruntimeD.Compilationfails2.Given:publicclassPass{publicstaticvoidmain(String[]args){intx=5;Passp=newPass();p.doStuff(x);System.out.print("mainx="+x);}voiddoStuff(intx){System.out.print("doStuffx="+x++);}}Whatistheresult?A.doStuffx=6mainx=6B.doStuffx=5mainx=5C.

9、doStuffx=5mainx=6D.doStuffx=6mainx=53.Given:Stringa="str";Stringb=newString("str");Stringc="str";System.out.print(a==b);System.out.print(a==c);Whatistheresult?A.truefalseB.truetrueC.falsetrueD.falsefalse4.Given:33.try{34.//smoecodehere35.}catch(NullPointerExceptionel){36.Syste

10、m.out.print("a");37.}catch(RuntimeExceptionel){38.System.out.

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

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

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