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

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

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

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

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

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

选择题(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. Hiding B. Overriding C. Overloading D. ThisfeatureisnotsupportedinJava Howtoexecutethefollowingprogram? publicclassTest{ publicstaticvoidmain(Stringargs[]){ System.out.println(args[0]); } } A. javaTest.class B. javaTest C. javaTestaString D. javacTest Ifacontainerhasbeenresized,whichofthefollowinglayoutmanagerdidnotchangetheinternalcomponents'size? A. CardLayout B. FlowLayout C. BorderLayout D. GridLayout Whichistherightstatementaboutexceptionhandling? A. Injava,allexceptionsarenecessarytobecaughtandhandled. B. The“catch”statementcatchesexceptionbytype-matching. C. Inthe“try-catch-finally”str