




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
第一章單元測試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第二章單元測試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.*第三章單元測試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第四章單元測試1【判斷題】Thenumberofargumentsinthemethodcallmustmatchthenumberofparametersinthemethoddeclaration’sparameterlist.()A.對B.錯2【判斷題】Floating-pointA.對B.錯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.對B.錯12【判斷題】Aprimitive-typevariablecanbeusedtoinvokeamethod.()A.對B.錯13【判斷題】Variablesdeclaredinthebodyofaparticularmethodareknownasinstancevariablesandcanbeusedinallmethodsoftheclass.()A.對B.錯第五章單元測試1【判斷題】Reference-typeinstancevariablesareinitializedbydefaulttotheA.對B.錯2【判斷題】Anyclassthatcontainspublicstaticvoidmain(String[]args)canbeusedtoexecuteanapp.()A.錯B.對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第六章單元測試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};第七章單元測試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.第八章單元測試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. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年CPBA行業(yè)趨勢試題及答案
- 2025屆河南省八市學評高三下學期聯合考試化學試題含解析
- 往來會計年終工作總結
- 殯葬職業(yè)測試題及答案
- 技能提升的商業(yè)分析師試題及答案
- CPBA考試信息整合與決策制定能力分析試題及答案
- 2024年自考行政管理考題趨勢試題及答案
- 2024年CPBA考試流程試題及答案
- 商業(yè)分析師考試重要提醒與試題及答案
- 2024年漢語言文學小自考技能培養(yǎng)試題及答案
- 教科版科學五年級下冊全冊全套課件【最新版】
- 胎兒頸項透明層(NT)的超聲診斷課件
- 工程移交單(標準樣本)
- 中綠的制度課
- 《最好的未來》合唱曲譜
- 常用材料折彎系數表大全
- 小班語言《坐火車》課件
- FIDIC合同《設計采購施工(EPC)交鑰匙工程合同條件》(中英文對照版)
- 環(huán)境監(jiān)測課件:第3章 空氣和廢氣監(jiān)測2
- 航空航天概論(課堂PPT)
- 律師刑事訴訟格式文書一至十九
評論
0/150
提交評論