Java东华理工大学试卷B.doc

Java东华理工大学试卷B.doc

ID:55550532

大小:44.50 KB

页数:9页

时间:2020-05-16

Java东华理工大学试卷B.doc_第1页
Java东华理工大学试卷B.doc_第2页
Java东华理工大学试卷B.doc_第3页
Java东华理工大学试卷B.doc_第4页
Java东华理工大学试卷B.doc_第5页
资源描述:

《Java东华理工大学试卷B.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、东华理工大学2012—2013学年第1学期考试试卷JAVA程序设计课程闭卷课程类别:考查B题号一二三四五六七八九总分分数评卷人1选择题(共35分)1.Whatissuffix(后缀)ofJavaclassfile?()?A、.javaB、.classC、.txtD、.ext2.WhichcommandcanrunJavaclassfile?()?A、editB、dirC、javaD、javac3.Whichidentifiesisillegal()?A、$_123B、中国C、you_can_alDsome++name4.Whichconversion(转换)isleg

2、al()?A、intx=1000.1;B、intx=’a’;C、shortx=10000;D、intx=12L;5.classexample{publicstaticvoidmain(Stringargs[]){booleanb;b=(4>3)&&(3<2);System.out.print("b="+b);b=false

3、

4、true;System.out.println("b="+b);}}Whatistheresult?()A、b=falseb=trueB、b=trueb=falseC、b=trueb=trueD、b=falseb=false6.classexam

5、ple{publicstaticvoidmain(Stringargs[]){int[]a={1,2,3,4,5};inti=3;a[i--]=a[i--]+2;System.out.println(a[i++]);}}Whatistheresult?()A,4B,5C3,D,27.classgggg{Stringtr=newString("hello");char[]th={'a','b','n'};publicvoidchange(Stringstr,charch[]){str="tcwtok";ch[0]='z';}publicstaticvoidmain(St

6、ringargs[]){ggggex=newgggg();ex.change(ex.tr,ex.th);System.out.print(ex.tr+"and");System.out.print(ex.th);}}Whatistheresult?()AhelloandabcBhelloandokChelloandzbnDtcwtok8.Setx=1,y=2,z=3,expressiony-=z--%++x;whatisresult()A1B3.5C4D59.Whatisresult?()classexample{staticintb=8;inta=4;publics

7、taticvoidmain(Stringargs[]){newexample().b++;newexample().a+=2;System.out.println(newexample().a);}}A6B7C4D510.1.classX{2.publicstaticvoidmain(Stringargs[]){3.Strings1=newString(“true”);4.Booleanb1=newBoolean(true);5.if(!s1.equals(b1)){6.System.out.println(“equal”);}}}Atheprogramrunsand

8、printsnothingBtheprogramrunsandprints“equal”CAnerroratline5causescompilationtofailDTheprogramrunsbutabortswithanexception11.1.interfaceA{2.voiddisplay(){};3.voidshow();4.}5.classBimplementA{6.voidshow(){}7.publicdisplay(){}publicstaticvoidmain(Stringargs[]){}}Whichlinesareincorrectwhent

9、hecodeiscompiled?A57B256C568D5612.classA{inta=2;voidshow(){System.out.println(“s”);}}classBextendsA{inta=3;voidshow(){System.out.println(“v”);}}classtest{publicstaticvoidmain(Stringargs[]){Ag=newB();g.show();}}Whatisresult?()AsBnoresultCvDsv13.whatisresult()classA{publicstaticv

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

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

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