预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共13页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

软件学院_面向对象程序设计_2008-2009(2)期末B卷精品文档精品文档收集于网络,如有侵权请联系管理员删除收集于网络,如有侵权请联系管理员删除精品文档收集于网络,如有侵权请联系管理员删除选择题(30分)说明:每题2分,只有1个正确答案,请将正确答案填写在下面表格中。题号123456789101112131415答案WhichofthefollowingstatementsiscorrectaboutJavapackages?A.Apackagemaycontainunlimitednumberofnestedsub-packages.B.ApackageisacollectionofrelatedJavasourceprogram.C.Usingtheimportstatementcanincludealltheclassesintothecurrentprogramfromaspecifiedpackageanditssub-packages.D.Ifthereisnopackagestatementused,thecurrentclasswillnotbeinanypackage.WhichoneisthewrongstatementaboutJavaconstructors?A.Thenameofaconstructormustbethesameasitsclass’sname.B.Aconstructorhasnoreturnvalueandcannotbemodifiedbyvoid.C.Aconstructoroftheparentclasscannotbeinheritedbyitssub-classes.D.Allconstructorsmustbemodifiedbypublic.Givingthecodebellow:classTest{privateintm;publicstaticvoidfun(){/*somecode...*/}}Howtomakethemembervariablemaccessibleformethodfun()?A.change"privateintm"to"protectedintm"B.change"privateintm"to"publicintm"C.change"privateintm"to"staticintm"D.change"privateintm"to"intm"Whichofthefollowingfunctionsisanoverloadingfunctionof"publicvoidexample(){...}"?A.publicvoidexample(){...}B.publicintexample(){...}C.publicvoidexample2(){...}D.publicintexample(intm,floatf){...}InJava,aclassmayhavemanydifferentmethodswiththesamename.Thenumber,type,sequencesofargumentsinthesemethodsaredifferent,andthereturnvaluecanbedifferentaswell.Whatdowecallthisfeatureintermsofobject-orientedprogramming?A.HidingB.OverridingC.OverloadingD.ThisfeatureisnotsupportedinJavaHowtoexecutethefollowingprogram?publicclassTest{publicstaticvoidmain(Stringargs[]){System.out.println(args[0]);}}A.javaTest.classB.javaTestC.javaTestaStringD.javacTestIfacontainerhasbeenresized,whichofthefollowinglayoutmanagerdidnotchangetheinternalcomponents'size?A.CardLayoutB.FlowLayoutC.BorderLayoutD.GridLayoutWhichistherightstatementaboutexceptionhandling?A.Injava,allexceptionsarenecessarytobecaughtandhandled.B.The“catch”statementcatchesexceptionbytype-matching.C.Inthe“try-catch-fi