在線網(wǎng)課知慧《面向?qū)ο蟪绦蛟O(shè)計(jì)(山盟-齊工)》單元測(cè)試考核答案_第1頁(yè)
在線網(wǎng)課知慧《面向?qū)ο蟪绦蛟O(shè)計(jì)(山盟-齊工)》單元測(cè)試考核答案_第2頁(yè)
在線網(wǎng)課知慧《面向?qū)ο蟪绦蛟O(shè)計(jì)(山盟-齊工)》單元測(cè)試考核答案_第3頁(yè)
在線網(wǎng)課知慧《面向?qū)ο蟪绦蛟O(shè)計(jì)(山盟-齊工)》單元測(cè)試考核答案_第4頁(yè)
在線網(wǎng)課知慧《面向?qū)ο蟪绦蛟O(shè)計(jì)(山盟-齊工)》單元測(cè)試考核答案_第5頁(yè)
已閱讀5頁(yè),還剩14頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

第一章單元測(cè)試1【單選題】(2分)WhicheditionofJavaisgearedtowarddevelopinglarge-scale,distributednetworkingapplicationsandweb-basedapplications?()A.EnterpriseEdition.B.StandardEdition.C.IndustrialEdition.D.MicroEdition.2【單選題】(2分)Javawasoriginallydevelopedfor:()A.Personalcomputers.B.Operatingsystemsdevelopment.C.Distributedcomputing.D.Intelligentconsumerdevices.3【單選題】(2分)WhichofthefollowingstatementsaboutJavaClassLibrariesisfalse:()A.JavaclasslibrariesarenotportableB.JavaclasslibrariesarealsoknownasJavaAPIs(ApplicationProgrammingInterfaces).C.AnadvantageofusingJavaclasslibrariesissavingtheeffortofdesigning,developingandtestingnewclasses.D.Javaclasslibrariesconsistofclassesthatconsistofmethodsthatperformtasks.4【單選題】(2分)The.classextensiononafilemeansthatthefile:()A.isproducedbytheJavacompiler(javac).B.Noneoftheabove.C.ContainsjavasourcecodeD.ContainsHTML5【單選題】(2分)Thecommand________executesaJavaapplication.()A.javacB.runC.javaD.Noneoftheabove第二章單元測(cè)試1【單選題】(2分)End-of-linecommentsthatshouldbeignoredbythecompileraredenotedusing()A.Threeforwardslashes(///).B.Aslashandastar(/*).C.Twoforwardslashes(//).D.Aslashandtwostars(/**).2【單選題】(2分)WhichofthefollowingisnotavalidJavaidentifier?()A.myValueB.m_xC.widthD.$_AAA13【單選題】(2分)WhichofthefollowingcannotcauseasyntaxerrortobereportedbytheJavacompiler?()A.Missing*/inacommentthatbeginswith/*B.Mismatched{}C.Missing;D.Anextrablankline.4【單選題】(2分)Whichofthefollowingdoesnotcontainasyntaxerror?()A.System.out.println("Helloworld!");B.System.out.println(Helloworld!);C.System.out.println('Helloworld!'):D.System.out.println("Hello回車換行world!");5【單選題】(2分)WhichcommandcompilestheJavasourcecodefileWelcome.java?()A.cdWelcome.javaB.javaWelcome.javaC.compileWelcome.javaD.javacWelcome.java6【單選題】(2分)WhichcommandexecutestheJavaclassfileWelcome.class?()A.javaWelcome.classB.javawelcomeC.javaWelcomeD.runWelcome.class7【單選題】(2分)Whichistheoutputofthefollowingstatements?()A.HelloWorldB.HelloWorldC.WorldHelloD.HelloWorld8【單選題】(2分)Whichstatementprintsthefloating-pointA.System.out.printf("%d10.3",123.456);B.System.out.printf("%10.3f",123.456);C.System.out.printf("%f10.3",123.456);D.System.out.printf("%10.3d",123.456);9【單選題】(2分)Whatisthesizeinbitsofanint?()A.32B.8C.64D.1610【單選題】(2分)Whichofthefollowingistheescapecharacter?()A.\nB.\C."D.*第三章單元測(cè)試1【單選題】(2分)Whichofthefollowingcanbeusedinaswitchstatementintheexpressionafterkeywordcase?a.aconstantintegralexpression.b.acharacterconstant.c.aStringd.anenumerationconstant.()A.All.B.bandcC.aandb.D.aandc2【單選題】(2分)Optionalparenthesesinexpressionsaresaidtobe()A.binaryoperators.B.implied.C.redundant.D.declared.3【單選題】(2分)WhichofthefollowingstatementsdoesnotaltertheA.number=12;B.y=y+2;C.inta;D.width=Integer.parseInt(input);4【單選題】(2分)WhatistheA.127B.119C.59D.515【單選題】(2分)Whichofthefollowingisnotanarithmeticoperator?()A.+B..C.%D.-6【單選題】(2分)Whichofthefollowingisnotacompilationerror?()A.Neglectingtoinitializealocalvariableinamethodbeforeitisused.B.Omittingtheleftandrightparenthesisfortheconditionofanifstatement.C.Allarecompilationerrors.D.Placingasemicolonattheendofthefirstlineofanifstatement.7【單選題】(2分)Eachofthefollowingisarelationalorequalityoperatorexcept:()A.B.<=C.==D.=!8【單選題】(2分)Whichofthefollowingisnotacontrolstructure:()A.Selectionstructure.B.Declarationstructure.C.Sequencestructure.D.Repetitionstructure.9【單選題】(2分)Whichstatementisfalse?()A.Unlessdirectedotherwise,thecomputerexecutesJavastatementsoneaftertheotherintheorderinwhichthey'rewritten.B.ActivitydiagramsnormallyshowtheJavacodethatimplementstheactivity.C.Thearrowsintheactivitydiagramrepresenttransitions,whichindicatetheorderinwhichtheactionsrepresentedbytheactionstatesoccur.D.Likepseudocode,activitydiagramshelpprogrammersdevelopandrepresentalgorithms.10【單選題】(2分)Whichofthefollowingisadouble-selectioncontrolstatement?()A.if…elseB.forC.do…whileD.if第四章單元測(cè)試1【判斷題】Thenumberofargumentsinthemethodcallmustmatchthenumberofparametersinthemethoddeclaration’sparameterlist.()A.對(duì)B.錯(cuò)2【判斷題】Floating-pointA.對(duì)B.錯(cuò)3【單選題】(2分)Eachclassyoucreatebecomesanew________thatcanbeusedtodeclarevariablesandcreateobjects.()A.type.B.instanceC.packageD.library4【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Eachclassdeclarationthatbeginswiththeaccessmodifierprivatemustbestoredinafilethathasthesamenameastheclassandendswiththe.javafilenameextension.B.Class,methodandvariablenamesareidentifiers.C.Anobjecthasattributesthatareimplementedasinstancevariablesandcarriedwithitthroughoutitslifetime.D.Everyclassdeclarationcontainskeywordclassfollowedimmediatelybytheclass’sname.5【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Byconventionclassnamesbeginwithanuppercaseletter,andmethodandvariablenamesbeginwithalowercaseletter.B.Instancevariablesexistbeforemethodsarecalledonanobject,whilethemethodsareexecutingandafterthemethodscompleteexecution.C.Aclassnormallycontainsoneormoremethodsthatmanipulatetheinstancevariablesthatbelongtoparticularobjectsoftheclass.D.Instancevariablescanbedeclaredanywhereinsideaclass.6【單選題】(2分)Whichofthefollowingstatementsistrue?()A.Mostinstance-variabledeclarationsareprecededwiththekeywordpublic,whichisanaccessmodifier.B.Noneoftheaboveistrue.C.Variablesormethodsdeclaredwithaccessmodifierprivateareaccessibleonlytomethodsoftheclassinwhichthey’redeclared.D.Eachobject(instance)oftheclasssharestheclass’sinstancevariables.7【單選題】(2分)Whenamethodterminates,theA.restoredB.lostC.savedD.copied8【單選題】(2分)Whichofthefollowingstatementsistrue?()A.ThedefaultB.EveryinstancevariablehasadefaultinitialC.Theargumenttypesinthemethodcallmustbeidenticaltothetypesofthecorrespondingparametersinthemethod’sdeclaration.D.Localvariablesareautomaticallyinitialized.9【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Thejavaccommandcancompilemultipleclassesatonce;simplylistthesource-codefilenamesafterthecommandwitheachfilenameseparatedbyacommafromthenext.B.Alloftheabovearetrue.C.Theasterisk(*)injavac*.javaindicatesthatallfilesinthecurrentdirectoryendingwiththefilenameextension.javashouldbecompiled.D.Ifthedirectorycontainingtheappincludesonlyoneapp’sfiles,youcancompileallofitsclasseswiththecommandjavac*.java.10【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.IntheUML,eachclassismodeledinaclassdiagramasarectanglewiththreecompartments.Thetoponecontainstheclass’snamecenteredhorizontallyinboldface.Themiddleonecontainstheclass’sattributes,whichcorrespondtoinstancevariablesinJava.Thebottomonecontainstheclass’soperations,whichcorrespondtomethodsandconstructorsinJava.B.UMLrepresentsinstancevariablesasanattributename,followedbyacolonandthetype.C.TheUMLmodelsoperationsbylistingtheoperationnamefollowedbyasetofparentheses.Aplussign(+)infrontoftheoperationnameindicatesthattheoperationisapublic.D.PrivateattributesareprecededbythekeywordprivateintheUML.11【判斷題】Emptyparenthesesfollowingamethodnameinamethoddeclarationindicatethatthemethoddoesnotrequireanyparameterstoperformitstask.()A.對(duì)B.錯(cuò)12【判斷題】Aprimitive-typevariablecanbeusedtoinvokeamethod.()A.對(duì)B.錯(cuò)13【判斷題】Variablesdeclaredinthebodyofaparticularmethodareknownasinstancevariablesandcanbeusedinallmethodsoftheclass.()A.對(duì)B.錯(cuò)第五章單元測(cè)試1【判斷題】Reference-typeinstancevariablesareinitializedbydefaulttotheA.對(duì)B.錯(cuò)2【判斷題】Anyclassthatcontainspublicstaticvoidmain(String[]args)canbeusedtoexecuteanapp.()A.錯(cuò)B.對(duì)3【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Variablesdeclaredinthebodyofaparticularmethodarelocalvariablesandcanbeusedonlyinthatmethod.B.Everymethod’sbodyisdelimitedbyleftandrightbraces({and}).C.Amethod’sparametersarelocalvariablesofthemethod.D.Keywordnullindicatesthatamethodwillperformataskbutwillnotreturnanyinformation.4【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Emptyparenthesesfollowingamethodnameindicatethatthemethoddoesnotrequireanyparameterstoperformitstask.B.Whenamethodthatspecifiesareturntypeotherthanvoidiscalledandcompletesitstask,themethodmustreturnaresulttoitscallingmethodC.Themethod’sreturntypespecifiesthetypeofdatareturnedtoamethod’scaller.D.Classesoftenprovidepublicmethodstoallowtheclass’sclientstosetorgetprivateinstancevariables;thenamesofthesemethodsmustbeginwithsetorget.5【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Aclassinstancecreationexpressionbeginswithkeywordnewandcreatesanewobject.B.Scannermethodnextreadscharactersuntilanywhite-spacecharacterisencountered,thenreturnsthecharactersasaString.C.Tocallamethodofanobject,followtheobjectnamewithacomma,themethodnameandasetofparenthesescontainingthemethod’sarguments.D.Aconstructorissimilartoamethodbutiscalledimplicitlybythenewoperatortoinitializeanobject’sinstancevariablesatthetimetheobjectiscreated.6【單選題】(2分)Informationispassedtoamethodin________.()A.themethodbodyB.thatmethod’sreturnC.theargumentstothemethodD.themethodname7【單選題】(2分)Awell-designedmethod________.()A.performsasingle,well-definedtaskB.repeatscodefoundinothermethodsC.containsthousandsoflinesofcodeD.performsmultipleunrelatedtasks8【單選題】(2分)Todeclareamethodasstatic,placethekeywordstaticbefore________inthemethod’sdeclaration.()A.thereturntypeB.themethodnameC.theargumentlistD.themethodmodifier9【單選題】(2分)WhichisacorrectstaticmethodcallofMathclassmethodsqrt?()A.Mathmath=newMath();math.sqrt(900);B.math.sqrt(900);C.Math.sqrt(900);D.sqrt(900);10【單選題】(2分)WhichofthefollowingmethodsisnotintheMathclass?()A.ceilB.absC.logD.parseInt第六章單元測(cè)試1【單選題】(2分)MathstaticmethodrandomgeneratesarandomdoubleA.uptoandincluding1.0B.uptobutnotincluding100.0C.uptoandincluding100.0D.uptobutnotincluding1.02【單選題】(2分)WhichstatementcreatesarandomA.3+2*randomNumbers.nextInt(5);B.5+3*randomNumbers.nextInt(2);C.2+3*randomNumbers.nextInt(5);D.2+5*randomNumbers.nextInt(3);3【單選題】(2分)AsetofnamedconstantsthatstartwiththeA.enumerationB.classC.enumD.Noneoftheabove.4【單選題】(2分)Arraysare________.()A.usedtodrawasequenceoflines,orraysB.fixed-lengthentitiesC.variable-lengthentitiesD.datastructuresthatcontainupto10relateddataitems5【單選題】(2分)TypesinJavaaredividedintotwocategories.Theprimitivetypesareboolean,byte,char,short,int,long,floatanddouble.Allothertypesare________types.()A.declaredB.sourceC.staticD.reference6【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Primitive-typeinstancevariablesareinitializedbydefault.B.Variablesoftypesbyte,short,int,long,floatanddoubleareinitializedto0.C.Aprimitive-typevariablecanstoreexactlyoneD.Variablesoftypebooleanareinitializedtotrue.7【單選題】(2分)Whichofthefollowingstatementsaboutarraysaretrue?1:AnarrayisagroupofvariablescontainingA.1,2,4B.1,2,3,4C.1,3,4D.3,48【單選題】(2分)Aprogrammermustdothefollowingbeforeusinganarray:()A.declarethenreferencethearray.B.declarethencreatethearray.C.createthendeclarethearray.D.createthenreferencethearray.9【單選題】(2分)Considerthecodesegmentbelow.Whichofthefollowingstatementsisfalse?int[]g;g=newint[23];()A.TheB.gisareferencetoanarrayofintegers.C.Thefirststatementdeclaresanarrayreference.D.Thesecondstatementcreatesthearray.10【單選題】(2分)Whichofthefollowingstatementsaboutcreatingarraysandinitializingtheirelementsisfalse?()A.Whenanarrayiscreatedwithoperatornew,thenumberofelementsmustbeplacedinsquarebracketsfollowingthetypeofelementbeingstored.B.AforloopiscommonlyusedtosettheC.TheelementsofanarrayofintegershaveaD.Thenewkeywordshouldbeusedtocreateanarray.11【單選題】(2分)Whichofthefollowinginitializerlistswouldcorrectlysettheelementsofarrayn?()A.intn=newint(1,2,3,4,5);B.int[]n={1,2,3,4,5};C.intn[5]={1;2;3;4;5};D.arrayn[int]={1,2,3,4,5};第七章單元測(cè)試1【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Theclassfollowingtheextendskeywordinaclassdeclarationisthedirectsuperclassoftheclassbeingdeclared.B.Javausesinterfacestoprovidethebenefitsofmultipleinheritance.C.Asuperclassobjectisasubclassobject.D.Asubclassisoftenlargerthanitssuperclass.2【單選題】(2分)Inheritanceisalsoknownasthe()A.knows-arelationship.B.uses-arelationship.C.has-arelationship.D.is-arelationship.3【單選題】(2分)Whichofthefollowingisnotasuperclass/subclassrelationship?()A.Noneoftheabove.B.Sailboat/Tugboat.C.Vehicle/Car.D.Employee/HourlyEmployee.4【單選題】(2分)Anadvantageofinheritanceisthat:()A.Allmethodscanbeinherited.B.Objectsofasubclasscanbetreatedlikeobjectsoftheirsuperclass.C.Noneoftheabove.D.Allinstancevariablescanbeuniformlyaccessedbysubclassesandsuperclasses.5【單選題】(2分)Whichofthefollowingkeywordsallowsasubclasstoaccessasuperclassmethodevenwhenthesubclasshasoverriddenthesuperclassmethod?()A.base.B.super.C.this.D.public.6【單選題】(2分)Usingtheprotectedkeywordalsogivesamember:()A.privateaccess.B.publicaccess.C.packageaccess.D.blockscope.7【單選題】(2分)Superclassmethodswiththislevelofaccesscannotbecalledfromsubclasses.()A.protected.B.public.C.private.D.package.8【單選題】(2分)Whichofthefollowingstatementsisfalse?()A.Aclass'sinstancevariablesarenormallydeclaredprivatetoenforcegoodsoftwareengineering.B.Iftheclassyou'reinheritingfromdeclaresinstancevariablesasprivate,theinheritedclasscanaccessthoseinstancevariablesdirectly.C.It'softenmuchmoreefficienttocreateaclassbyinheritingfromasimilarclassthantocreatetheclassbywritingeverylineofcodethenewclassrequires.D.AclasscandirectlyinheritfromclassObject.9【單選題】(2分)EveryclassinJava,except________,extendsanexistingclass.()A.Object.B.String.C.Integer.D.Class.10【單選題】(2分)Overridingamethoddiffersfromoverloadingamethodbecause:()A.Overriddenmethodshavethesamesignature.B.Neitheroftheabove.C.Bothoftheabove.D.Overloadedmethodshavethesamesignature.第八章單元測(cè)試1【單選題】(2分)A(n)_____classcannotbeinstantiated.()A.polymorphic.B.abstract.C.concrete.D.final.2【單選題】(2分)Non-abstractclassesarecalled________.()A.instanceclasses.B.concreteclasses.C.implementableclasses.D.realclasses.3【單選題】(2分)Ifthesuperclasscontainsonlyabstractmethoddeclarations,thesuperclassisusedfor________.()A.Both.B.implementationinheritance.C.interfaceinheritance.D.Neither.4【單選題】(2分)Whichofthefollowingcouldbeusedtodeclareabstractmethodmethod1inabstractclassClass1(method1returnsanintandtakesnoarguments)?()A.publicintmethod1();B.publicabstractintmethod1();C.publicintabstractmethod1();D.publicintnonfinalmethod1();5【單選題】(2分)Whichofthefollowingstatementsaboutabstractsuperclassesistrue?()A.abstractsuperclassesmustdeclareallmethodsasabstract.B.abstractsuperclassesmustdeclarea

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論