欢迎来到天天文库
浏览记录
ID:35568127
大小:90.50 KB
页数:7页
时间:2019-03-29
《java程序设计基础本部(b)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、.装订线内不要答题,装订线外不要写姓名、学号、学院专业年级班签个人信息,违者试卷作0分处理考点号教室号姓名学院专业年级班号学号(全号)湖南农业大学课程考核试卷课程名称(全称):Java程序设计基础(双语)课程代码:30656B0考核时间:2008年月日试卷号:B考核对象:信息工程05-1、信息工程05-2大题号一二三四五六七八九十总分题分4020201010得分得分I、Chooseonecorrectanswer(Total40points,eachquestion2points)1.WhichofthefollowingareJavamodifiers
2、?(A)A.publicB.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")
3、;}}publicclassBottom2extendsTop{publicBottom2(Strings){System.out.print("D");}publicstaticvoidmain(String[]args){newBottom2("C");System.out.println("");}}What’stheresultwhenwecompileandruntheprecedingcode?(D)A.BDB.DBC.BDCD.Compilationfails5.Whatisthereturnvalueofthemain()methodin
4、Java?(D)A.StringB.intC.charD.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.
5、Noneoftheabovestatementswillcompile.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.Giventhefollo
6、wingcode:switch(m){case0:System.out.println(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.
7、3D.410.WhichmodifierisNOTlegalinJava?(D)A.privateB.publicC.protectedD.protect11.Whichmethodisusedtodefinetheexecutionbodyofathread?(C)A.start()B.init()C.run()D.main()12.Giventhefollowingclassdefinitioninonesourcefile:classBase{publicBase(){//...}publicBase(intm){//...}protectedvo
8、idfun(intn){//...}}publicclassChildexten
此文档下载收益归作者所有