欢迎来到天天文库
浏览记录
ID:18394733
大小:91.00 KB
页数:7页
时间:2018-09-17
《java程序设计基础本部(b)new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、装订线内不要答题,装订线外不要写姓名、学号、学院专业年级班签个人信息,违者试卷作0分处理考点号教室号姓名学院专业年级班号学号(全号)湖南农业大学课程考核试卷课程名称(全称):Java程序设计基础(双语)课程代码:30656B0考核时间:2008年月日试卷号:B考核对象:信息工程05-1、信息工程05-2大题号一二三四五六七八九十总分题分4020201010得分得分I、Chooseonecorrectanswer(Total40points,eachquestion2points)1.WhichofthefollowingareJavamodifiers?(A)A.pub
2、licB.trueC.friendlyD.transient2.Choosethevalididentifierfromthoselistedbelow.(A)A.MyMethodB.3byteC.5_constD.true3.Whicharelegaldeclarations?(ABD)A.shortx[];B.short[]y;C.short[]y2=[5];D.short[]z[][];4.Giventhefollowingcode:classTop{publicTop(Strings){System.out.print("B");}}publicclassBot
3、tom2extendsTop{publicBottom2(Strings){System.out.print("D");}publicstaticvoidmain(String[]args){newBottom2("C");System.out.println("");}}What’stheresultwhenwecompileandruntheprecedingcode?(D)A.BDB.DBC.BDCD.Compilationfails5.Whatisthereturnvalueofthemain()methodinJava?(D)A.StringB.intC.ch
4、arD.void6.Giventhefollowing,classX{voiddol(){}}classYextendsX{voiddo2(){}}classChrome{publicstaticvoidmain(String[]args){Xx1=newX();Xx2=newY();Yy1=newY();//insertcodehere}}Which,insertedatline8,willcompile?(C)A.x2.do2();B.(Y)x2.do2();C.((Y)x2).do2();D.Noneoftheabovestatementswillcompile.
5、7.WhichofthefollowingassignmentsisNOTlegal?(A)A.floata=2.0B.doubleb=2.0C.intc=2D.longd=28.Giventhefollowingcommandtorunacorrectclass:javaMyTestabcWhichstatementistrue?(D)A.args[0]=MyTestabcB.args[0]=MyTestC.args[0]=aD.args[1]=“b”9.Giventhefollowingcode:switch(m){case0:System.out.println(
6、Condition0);case1:System.out.println(Condition1);case2:System.out.println(Condition2);case3:System.out.println(Condition3);break;default:System.out.println(OtherCondition);}WhichvaluesofmwillcauseCondition2isoutput?(A)A.0,1and2B.only1C.3D.410.WhichmodifierisNOTlegalinJava?(D)A.privateB.p
7、ublicC.protectedD.protect11.Whichmethodisusedtodefinetheexecutionbodyofathread?(C)A.start()B.init()C.run()D.main()12.Giventhefollowingclassdefinitioninonesourcefile:classBase{publicBase(){//...}publicBase(intm){//...}protectedvoidfun(intn){//...}}publicclassChildextendsBa
此文档下载收益归作者所有