Java东华理工大学试卷A及答案.doc

Java东华理工大学试卷A及答案.doc

ID:55550533

大小:38.00 KB

页数:10页

时间:2020-05-16

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

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

1、东华理工大学2012—2013学年第1学期考试试卷Java程序设计课程闭课程类别:考查A题号一二三四五六七八九总分分数评卷人1选择题(共35分)1.Whatissuffix(后缀)ofJavasourcecode?(A)?A、.javaB、.classC、.txtD、.ext2.WhichcommandcancompileJavasourcecode?(D)?A、editB、dirC、javaD、javac3.Whichidentifiesisillegal(C)?A、$_$123B、_somethingC、

2、some**nameD、you_can_al4.Whichconversion(转换)isillegal(B)?注意:byte类型的范围-128-127A、shortx=1000;B、bytex=1000;C、bytex=100;D、floatx=12L;5.classexample{publicstaticvoidmain(Stringargs[]){booleanb;b=(2>3)&&(3<2);System.out.print("b="+b);b=false

3、

4、true;System.out.print

5、ln("b="+b);}}Whatistheresult?(A)A、b=falseb=trueB、b=trueb=falseC、b=trueb=trueD、b=falseb=false6.classexample{publicstaticvoidmain(Stringargs[]){inti=1;a[i++]=a[i++]+2;System.out.println(a[i++]);}}Whatistheresult?(C)A,4B,5C3,D,67.publicclassExample{  Stringstr

6、=newString("good");  char[]ch={'a','b','c'};  publicstaticvoidmain(Stringargs[]){    Exampleex=newExample();    ex.change(ex.str,ex.ch);    System.out.print(ex.str+"and");    Sytem.out.print(ex.ch);}  publicvoidchange(Stringstr,charch[]){    str="testok";  

7、  ch[0]='g'; }}Whatistheresult?(D)AgoodandabcBgoodandgbcCtestokandabcDtestokandgbc8.Setx=1,y=2,z=3,expression:y+=z--/++xwhatisresult(A)A3B3.5C4D59.whatisresult(A)?classexample{staticinta=3;publicstaticvoidmain(Stringargs[]){newexample().a++;newexample().a+=

8、2;System.out.println(example.a);}}A6B7C4D510.1.classX{(D)2.publicstaticvoidmain(Stringargs[]){3.Strings1=newString(“true”);4.Booleanb1=newBoolean(true);5.if(s1.equals(b1)){6.System.out.println(“equal”);}}}AtheprogramrunsandprintsnothingBtheprogramrunsandpri

9、nts“equal”CAnerroratline5causescompilationtofailDTheprogramrunsbutabortswithanexception11.1.interfaceA{2.inta=3;3.voidshow();4.}5.classBimplementA{6.voidshow(){}7.publicstaticvoidmain(Stringargs[]){8.System.out.println(a++);}}Whichlinesareincorrectwhentheco

10、deiscompiled?(C)A57B68C568D5612classA{inta=2;}classBextendsA{inta=3;}classtest{publicstaticvoidmain(Stringargs[]){Ag=newB();//不能把子类的东西给父类System.out.println(g.a);}}Whatisresult?(B)A2BnoresultC1D313whati

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

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

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