版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
面向?qū)ο蟪绦蛟O(shè)計(jì)知到智慧樹期末考試答案題庫(kù)2025年齊魯工業(yè)大學(xué)Whichsuperclassmembersareinheritedbyallsubclassesofthatsuperclass?()
答案:protectedinstancevariablesandmethods.Whichstatementprintsthefloating-pointvalue123.456rightjustifiedwithafieldwidthof10?()
答案:System.out.printf("%10.3f",123.456);Whichstatementistruewhenasuperclasshasprotectedinstancevariables?()
答案:Alloftheabove.Whichstatementisfalse?()
答案:ActivitydiagramsnormallyshowtheJavacodethatimplementstheactivity.Whichstatementcreatesarandomvaluefromthesequence2,5,8,11and14.SupposerandomNumbersisaSecureRandomobject.()
答案:2+3*randomNumbers.nextInt(5);WhichstatementcorrectlypassesthearrayitemstomethodtakeArray?Arrayitemscontains10elements.()
答案:takeArray(items).Whichoperatorcanbeusedinstringconcatenation?()
答案:+=Whichofthesestatementsbestdefinesscope?()
答案:Scopeistheportionofaprogramthatcanrefertoanentitybyitssimplename.Whichofthefollowingwouldnotbeusedtoclarifyadangling-else?()
答案:Parentheses().Whichofthefollowingwillnotproduceacompilererror?()
答案:Changingthevalueatagivenindexofanarrayafteritiscreated.Whichofthefollowingwillnothelppreventinfiniteloops?()
答案:Includebracesaroundthestatementsinado…whilestatement.Whichofthefollowingwillcountdownfrom10to1correctly?()
答案:for(intj=10;j>=1;j--)Whichofthefollowingstatementsistrue?()
答案:Variablesormethodsdeclaredwithaccessmodifierprivateareaccessibleonlytomethodsoftheclassinwhichthey’redeclared.Whichofthefollowingstatementsisfalse?()
答案:Withnon-staticinterfacemethods,helpermethodscannowbedeclareddirectlyininterfacesratherthaninseparateclasses.Whichofthefollowingstatementsis?()
答案:Variablesoftypefloatrepresentdouble-precisionfloating-pointnumbers;theserequiretwiceasmuchmemoryasdoublevariables.Whichofthefollowingstatementsdoesnotalterthevaluestoredinamemorylocation?()
答案:inta;Whichofthefollowingstatementsdescribesblockscope?()
答案:Itbeginsattheidentifier'sdeclarationandendsattheterminatingrightbrace(}).Whichofthefollowingstatementscreatesamultidimensionalarraywith3rows,wherethefirstrowcontains1element,thesecondrowcontains4elementsandthefinalrowcontains2elements?()
答案:int[][]items={{1},{2,3,4,5},{6,7}};Whichofthefollowingstatementsabouttheconditionaloperator(?:)isfalse?()
答案:Thesecondoperandistheresultvalueiftheconditionevaluatestofalse.WhichofthefollowingstatementsaboutJavaClassLibrariesisfalse:()
答案:JavaclasslibrariesarenotportableWhichofthefollowingstatementsaboutcreatingarraysandinitializingtheirelementsisfalse?()
答案:Theelementsofanarrayofintegershaveavalueofnullbeforetheyareinitialized.Whichofthefollowingstatementsaboutarraysaretrue?1:Anarrayisagroupofvariablescontainingvaluesthatallhavethesametype.2:Elementsarelocatedbyindex.3:Thelengthofanarraycisdeterminedbytheexpressionc.length();4:Thezerothelementofarraycisspecifiedbyc[0].()
答案:1,2,4Whichofthefollowingstatementsaboutabstractsuperclassesistrue?()
答案:abstractsuperclassesmaycontaindata.Whichofthefollowingpromotionsofprimitivetypesisnotallowedtooccur?()
答案:doubletofloat.Whichofthefollowingprimitivetypesisneverpromotedtoanotherprimitivetype?()
答案:Bothaandc.Whichofthefollowingoperatorsassociatesfromlefttoright?()
答案:/WhichofthefollowingmethodsisnotintheMathclass?()
答案:parseIntWhichofthefollowingkeywordsallowsasubclasstoaccessasuperclassmethodevenwhenthesubclasshasoverriddenthesuperclassmethod?()
答案:super.Whichofthefollowingistheescapecharacter?()
答案:\Whichofthefollowingisnotpossible?()
答案:Aclassthatinheritsfromtwoclasses.Whichofthefollowingisnotanarithmeticoperator?()
答案:.WhichofthefollowingisnotavalidJavaidentifier?()
答案:myValueWhichofthefollowingisnotatypeofrepetitionstatementinJava?()
答案:loopstatement.Whichofthefollowingisnotasuperclass/subclassrelationship?()
答案:Sailboat/Tugboat.Whichofthefollowingisnotaprimitivetype?()
答案:StringWhichofthefollowingisnotapackageintheJavaAPI?()
答案:ponentWhichofthefollowingisnotaJavaprimitivetype?()
答案:realWhichofthefollowingisnotaJavakeyword?()
答案:nextWhichofthefollowingisnotacontrolstructure:()
答案:Declarationstructure.Whichofthefollowingisnotacompilationerror?()
答案:Placingasemicolonattheendofthefirstlineofanifstatement.Whichofthefollowingisavariabledeclarationstatement?()
答案:inttotal;WhichofthefollowingisaScannermethodforinputtinganintegervalue?()
答案:nextIntWhichofthefollowingisadouble-selectioncontrolstatement?()
答案:if…elseWhichofthefollowinginitializerlistswouldcorrectlysettheelementsofarrayn?()
答案:int[]n={1,2,3,4,5};Whichofthefollowingescapesequencesrepresentsacarriagereturn?()
答案:\r.Whichofthefollowingdoesnotcontainasyntaxerror?()
答案:System.out.println("Helloworld!");Whichofthefollowingdoesnotcompletethesentencecorrectly?Interface______.()
答案:canbeinstantiated.Whichofthefollowingcouldbeusedtodeclareabstractmethodmethod1inabstractclassClass1(method1returnsanintandtakesnoarguments)?()
答案:publicabstractintmethod1();Whichofthefollowingcodesegmentsdoesnotincrementvalby3:()
答案:c=3;val=val+(c==3?2:3);Whichofthefollowingclassmembersshouldusuallybeprivate?()
答案:Variables(orfields).WhichofthefollowingcannotcauseasyntaxerrortobereportedbytheJavacompiler?()
答案:Anextrablankline.Whichofthefollowingcanbeusedinaswitchstatementintheexpressionafterkeywordcase?a.aconstantintegralexpression.b.acharacterconstant.c.aStringd.anenumerationconstant.()
答案:All.WhichmethodcallconvertsthevalueinvariablestringVariabletoaninteger?()
答案:Integer.parseInt(stringVariable)WhichisacorrectstaticmethodcallofMathclassmethodsqrt?()
答案:Math.sqrt(900);Whichexpressionisequivalenttoif(!(grade==sentinelValue))?()
答案:if(grade!=sentinelValue)Whichexpressionadds1totheelementofarrayarrayNameatindexi?()
答案:++arrayName[i].WhicheditionofJavaisgearedtowarddevelopinglarge-scale,distributednetworkingapplicationsandweb-basedapplications?()
答案:EnterpriseEdition.WhichcommandexecutestheJavaclassfileWelcome.class?()
答案:javaWelcomeWhichcommandcompilestheJavasourcecodefileWelcome.java?()
答案:javacWelcome.javaWhichcommandbelowrunsTestProgram,andpassesinthevaluesfiles.txtand3?()
答案:javaTestProgramfiles.txt3.WhichcaseofthefollowingwouldwarrantusingthebooleanlogicalinclusiveOR(|)ratherthantheconditionalOR(||)?()
答案:Testingifatleastoneoftwoconditionsistruewhentherightoperandhasarequiredsideeffect.Wherecanlocalvariablesdeclaredwithinamethod’sbodybeused?()
答案:Onlyinthatmethodbetweenthelineinwhichtheyweredeclaredandtheclosingbraceofthatmethod.Whenmethodprintfrequiresmultiplearguments,theargumentsareseparatedwith________.()
答案:commas(,).WhenanobjectisconcatenatedwithaString,________.()
答案:theobject’stoStringmethodisimplicitlycalledtoobtaintheStringrepresentationoftheobjectWhenasuperclassvariablereferstoasubclassobjectandamethodiscalledonthatobject,theproperimplementationisdeterminedatexecutiontime.Whatistheprocessofdeterminingthecorrectmethodtocall?()
答案:latebinding.Whenasubclassconstructorcallsitssuperclassconstructor,whathappensifthesuperclass’sconstructordoesnotassignavaluetoaninstancevariable?()
答案:Theprogramcompilesandrunsbecausetheinstancevariablesareinitializedtotheirdefaultvalues.Whenamethodterminates,thevaluesofitslocalvariablesare________.()
答案:lostWhatisthesizeinbitsofanint?()
答案:32Whatistheresultvalueofcattheendofthefollowingcodesegment?intc=8;c++;++c;c%=5;()
答案:0.Whathappenswhenthisisusedinaconstructor’sbodytocallanotherconstructorofthesameclassifthatcallisnotthefirststatementintheconstructor?()
答案:Acompilationerroroccurs.Variablesdeclaredinthebodyofaparticularmethodareknownasinstancevariablesandcanbeusedinallmethodsoftheclass.()
答案:錯(cuò)Usingtheprotectedkeywordalsogivesamember:()
答案:packageaccess.TypesinJavaaredividedintotwocategories.Theprimitivetypesareboolean,byte,char,short,int,long,floatanddouble.Allothertypesare________types.()
答案:referenceTodeclareamethodasstatic,placethekeywordstaticbefore________inthemethod’sdeclaration.()
答案:thereturntypeThestaticmethod________ofclassStringreturnsaformattedString.()
答案:format.Thenumberofargumentsinthemethodcallmustmatchthenumberofparametersinthemethoddeclaration’sparameterlist.()
答案:對(duì)Theformatspecifier%.2fspecifiesthattwodigitsofprecisionshouldbeoutput________inthefloating-pointnumber.()
答案:totherightofthedecimalpointThefilenameforthepublicclassthatbeginswithpublicclassAdditionmustbe()
答案:Addition.java.Theemptystatementisdenotedbywhatsymbol?()
答案:Semicolon;ThedefaultequalsimplementationofclassObjectdetermines:()
答案:whethertworeferencesrefertothesameobjectinmemory.Thecontrolvariableofacounter-controlledloopshouldbedeclaredas________topreventerrors.()
答案:intThecommand________executesaJavaapplication.()
答案:javaThe.classextensiononafilemeansthatthefile:()
答案:isproducedbytheJavacompiler(javac).Superclassmethodswiththislevelofaccesscannotbecalledfromsubclasses.()
答案:private.Staticclassvariables:()
答案:aresharedbyallobjectsofaclass.Sentinel-controlledrepetitionisalsoknownas________.()
答案:IndefiniterepetitionReference-typeinstancevariablesareinitializedbydefaulttothevaluenull.()
答案:對(duì)Programsremembernumbersandotherdatainthecomputer'smemoryandaccessthatdatathroughprogramelementscalled()
答案:variables.Primitive-typelocalvariablesareinitializedbydefault.()
答案:錯(cuò)Portionsofstatementsthatcontaincalculationsarecalled()
答案:expressions.Polymorphismallowsforspecificstobedealtwithduring:()
答案:execution.Overridingamethoddiffersfromoverloadingamethodbecause:()
答案:Overriddenmethodshavethesamesignature.Overloadedmethodsalwayshavethesame_________.()
答案:methodnameOptionalparenthesesinexpressionsaresaidtobe()
答案:redundant.Non-abstractclassesarecalled________.()
答案:concreteclasses.Methodcallscannotbedistinguishedby________.()
答案:returntypeMathstaticmethodrandomgeneratesarandomdoublevalueintherangefrom0.0()
答案:uptobutnotincluding1.0Localvariablesmustbe________.()
答案:initializedbeforetheirvaluesareusedinanexpression.Javawasoriginallydevelopedfor:()
答案:Intelligentconsumerdevices.Invalidpossibilitiesforarrayindicesinclude.()
答案:Negativeintegers.Inheritanceisalsoknownasthe()
答案:is-arelationship.Informationispassedtoamethodin________.()
答案:theargumentstothemethodInJavaSE7andearlier,aninterfacemaycontain:()
答案:publicstaticfinaldataandpublicabstractmethods.Inarrayitems,whichexpressionbelowaccessesthevalueatrow3andcolumn4?()
答案:items[3][4]Inanactivitydiagram,themergesymbolhasthesameshapeaswhatothersymbol?()
答案:Decisionsymbol.Ifthesuperclasscontainsonlyabstractmethoddeclarations,thesuperclassisusedfor________.()
答案:interfaceinheritance.Ifaclassdoesnotdefineconstructors,thecompilerprovidesadefaultconstructorwithnoparameters,andtheclass’sinstancevariablesareinitializedto_____.()
答案:theirdefaultvaluesIdentifiersinJavahave________and________scopes?()
答案:class,block.Havingathisreferenceallows:()
答案:Alloftheabove.GiventheJavastatementnumber1=input.nextInt();inwhichnumber1isanintandinputisaScanner,whichofthefollowingoccursiftheuserdoesnotenteravalidintvalue?()
答案:Aruntimelogicerroroccurs.Forthearraythatwasthecorrectanswerinthepreviousquestion,whatisthevaluereturnedbyitems[1][0]?()
答案:6.Floating-pointvaluesthatappearinsourcecodeareknownasfloating-pointliteralsandaretypefloatbydefault.()
答案:錯(cuò)EveryobjectinJavaknowsitsownclassandcanaccessthisinformationthroughmethod.()
答案:getClass.Everymethod’sbodyisdelimitedbyleftandrightbraces({and}).()
答案:對(duì)EveryclassinJava,except________,extendsanexistingclass.()
答案:Object.End-of-linecommentsthatshouldbeignoredbythecompileraredenotedusing()
答案:Twoforwardslashes(//).Emptyparenthesesfollowingamethodnameinamethoddeclarationindicatethatthemethoddoesnotrequireanyparameterstoperformitstask.()
答案:對(duì)Eachofthefollowingisarelationalorequalityoperatorexcept:()
答案:=!Eachclassyoucreatebecomesanew________thatcanbeusedtodeclarevariablesandcreateobjects.()
答案:type.Declaringinstancevariables________isknownasdatahidingorinformationhiding.()
答案:privateDeclaringamethodfinalmeans:()
答案:itcannotbeoverridden.Counter-controlledrepetitionisalsoknownas:()
答案:DefiniterepetitionConstructors:()
答案:Both(a)and(c).Constantvariablesalsoarecalled.()
答案:namedconstantsConsiderthecodesegmentbelow.Whichofthefollowingstatementsisfalse?int[]g;g=newint[23];()
答案:Thevalueofg[3]is-1.ConsiderclassesA,BandC,whereAisanabstractsuperclass,BisaconcreteclassthatinheritsfromAandCisaconcreteclassthatinheritsfromB.ClassAdeclaresabstractmethodoriginalMethod,implementedinclassB.WhichofthefollowingstatementsistrueofclassC?()
答案:Noneoftheabove.Compositionissometimesreferredtoasa(n)________.()
答案:has-arelationshipClassesandmethodsaredeclaredfinalforallbutthefollowingreasons:()
答案:finalmethodsarestatic.ClassArraysprovidesmethod__________forcomparingarraystodeterminewhethertheyhavethesamecontents.()
答案:equalsClassArraysmethodssort,binarySearch,equalsandfillareoverloadedforprimitive-typearraysandObjectarrays.Inaddition,methods__________and__________areoverloadedwithgenericversions.()
答案:binarySearch,equals.Byconvention,methodnamesbeginwithanuppercasefirstletter,andallsubsequentwordsinthenamebeginwithacapitalfirstletter.()
答案:錯(cuò)Attemptingtoaccessanarrayelementoutsideoftheboundsofanarray,causesa(n).()
答案:ArrayIndexOutOfBoundsException.Assigningasubclassreferencetoasuperclassvariableissafe________.()
答案:becausethesubclassobjectisanobjectofitssuperclass.Arraysare________.()
答案:fixed-lengthentitiesAnyclassthatcontainspublicstaticvoidm
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年國(guó)際關(guān)系與現(xiàn)代外交政策知識(shí)考察試題及答案解析
- 中學(xué)第二學(xué)期學(xué)校德育處工作行事歷及德育工作總結(jié)
- 2025年數(shù)字化轉(zhuǎn)型與企業(yè)創(chuàng)新測(cè)試題及答案
- 2025年房地產(chǎn)經(jīng)紀(jì)人資格考試考題及答案
- 醫(yī)院人員緊急替代應(yīng)急預(yù)案
- 礦井防塵工技能培訓(xùn)考試題庫(kù)及答案
- 2025年班組三級(jí)安全安全教育考試試題及答案
- 建設(shè)工程施工合同糾紛要素式起訴狀模板高清無(wú)水印下載
- 化驗(yàn)員求職面試技巧總結(jié)
- 2026年智慧城市建設(shè)培訓(xùn)
- 2025年海南三亞市吉陽(yáng)區(qū)教育系統(tǒng)公開招聘編制教師122人(第1號(hào))筆試歷年典型考題(歷年真題考點(diǎn))解題思路附帶答案詳解
- 2026年孝昌縣供水有限公司公開招聘正式員工備考題庫(kù)參考答案詳解
- 托管學(xué)校合作合同協(xié)議
- 產(chǎn)品銷售團(tuán)隊(duì)外包協(xié)議書
- 2025年醫(yī)保局支部書記述職報(bào)告
- 汽車充電站安全知識(shí)培訓(xùn)課件
- 世說(shuō)新語(yǔ)課件
- 全體教師大會(huì)上副校長(zhǎng)講話:點(diǎn)醒了全校200多名教師!毀掉教學(xué)質(zhì)量的不是學(xué)生是這7個(gè)環(huán)節(jié)
- 民航招飛pat測(cè)試題目及答案
- T-CDLDSA 09-2025 健身龍舞彩帶龍 龍舞華夏推廣套路技術(shù)規(guī)范
- DB35-T 2278-2025 醫(yī)療保障監(jiān)測(cè)統(tǒng)計(jì)指標(biāo)規(guī)范
評(píng)論
0/150
提交評(píng)論