如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
单项选择115题1.WhichistheJavakeywordusedtodenoteaclassmethod?(a)class(b)static(c)private(d)final2.Thetermclassvariableisasynonymfor(a)aread-onlyvariable(b)aprivatedatafield(c)astaticdatafield(d)aninstancevariable3.WhichofthefollowingstatementsaboutclassvariablesinJavaisnottrue?(a)Non-staticmethodsinaclasscanaccesstheclassvariabledefinedinthesameclass.(b)Allobjectshavetheirowncopyoftheclassvariabledefinedintheinstantiatedclass.(c)Classvariablesrequirethemodifierstaticinthedeclarations.(d)Classvariablesdonotneedthereferencetotheobjectoftheinstantiatedclasstoaccessthem.ConsiderthefollowingUMLclassdiagram.Thediagramdescribesa(a)one-to-onerelationship(b)relationshipbetweenasubclassandasuperclass(c)self-containingclass(d)classwithoutmethods5.Whenusingnoun-phraseanalysistomodelasoftwaresystem,whichofthefollowingshouldtypicallybeeliminatedfromthelistofpotentialclasses?I.ReferencestothesoftwaresystemitselfII.NounsthatimplyrolesbetweenobjectsIII.Synonymstoothernounsinthelist(a)IandIIIonly(b)I,II,andIII(c)IIIonly(d)IIandIIIonly6.WhichofthefollowingstatementsaboutconstructorsinJavaistrue?(a)Aclassmustdefineatleastoneconstructor.(b)Aclasscandefinemorethanoneconstructor.(c)Aconstructormustbedefinedasstatic.(d)Aconstructormustbedefinedaspublic.7.Ifa(n)_____exceptioncanoccurinamethodthatdoesnothaveacatchblocktohandlethatexception,thenathrowsclausethatliststhisexceptionmustbepartofthemethod_____.(a)unchecked,body(b)checked,body(c)checked,header(d)unchecked,header8.Ifaclasscontainsaconstructor,thatconstructorwillbeinvoked(a)onceatthebeginningofanyprogramthatusesthatclass(b)eachtimeanobjectofthatclassisinstantiated(c)oncethefirsttimeanobjectofthatclassisinstantiated(d)eachtimeanobjectofthatclassgoesoutofscope9.ConsiderthefollowingJavaprogramsegment.importjava.io.*;publicclassTest{publicTest(){System.out.println("default");}publicTest(inti){System.out.println("non-default");}publicstaticvoidmain(String[]args){Testt=newTest(2);}}Whi