欢迎来到天天文库
浏览记录
ID:37817906
大小:89.50 KB
页数:5页
时间:2019-05-31
《09级Java技术试题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、西安电子科技大学考试时间120分钟试题题号III总分分数1.考试形式:闭卷;2.考试日期:年月日3.本试卷共2大题,满分100分。班级学号姓名任课教师Note:Writeallanswersontheanswersheet.QuestionI:Multiplechoices(2*20=40points)1.WhichJDKcommandiscorrecttorunaJavaapplicationinmyProgram.java?A.javamyProgramB.javamyProgram.classC.javacmyProgram.javaD.javacmyPr
2、ogram2.Whichofthefollowingdefinitionsdefinesalegalinterface?A.interfaceA{abstractvoidunfinished(){}}B.interfaceA{abstractvoidunfinished();}C.interfaceA{voidunfinished();}D.publicinterfaceA{abstractvoidunfinished();}3.Whichofthefollowingstatementsarefalse?A.Aclasscanonlyextendoneclass
3、B.AclasscanimplementmorethanoneinterfaceC.AninterfacecannotextendotherinterfacesD.Aninterfacecanextendmorethanoneinterface4.Whichofthefollowingkeywordsnotbelongtothejavakeywords?A.constB.sizeofC.assertD.volatile5.SupposeAisanabstractclass,BisaconcretesubclassofA,andbothAandBhaveadefa
4、ultconstructor.Whichofthefollowingisnotcorrect?A.Aa=newA();B.Aa=newB();C.Bb=newB();D.BandCarecorrect5/56.Analyzethefollowingcode,theresultis:publicclassTest{publicstaticvoidmain(String[]args){Bb=newB();b.m(5);b.m(23.0);System.out.println("dis"+b.d);}}classA{protectedinti;publicvoidm(
5、inti){this.i=i;}}classBextendsA{doubled;publicvoidm(doubled){this.d+=d+i;}}A.dis28.0.B.run-timeerror.C.compileerror.D.dis23.0.7.Whatwillthefollowingprogramdisplaywhenyouattempttocompileandrunit?publicclassTest{//#1publicstaticvoidmain(String[]args){Objecta1=newA();Objecta2=newA();Aa3
6、=newA();Aa3=newA();Strings1=”Hello!”;Strings2=”Hello!”;System.out.println(a1.equals(a2));System.out.println(a3.equals(a4));System.out.println(s1.equals(s2));}}classA{intx;publicbooleanequals(Aa){returnthis.x==a.x;}}A.B.C.D.truetruefalsefalsefalsetruetruetruetruefalsefalsetrue5/58.Whi
7、choneofthefollowingstatementsisnotcorrect?A.inta[20];B.inta[]={1,2,3,4,5};C.int[][]a;D.inta[][];a=newint[2][];a=newint[2][3];a[0]=newint[2];a[1]=newint[3];9.IfstrisavariablewithString[]type,whichoneoffollowingcangetitslength?A.str.length()B.str.lengthC.str.size()D.str.size10.Supposey
8、ouhaveclasse
此文档下载收益归作者所有