面向?qū)ο蟪绦蛟O(shè)計知到智慧樹期末考試答案題庫2025年齊魯工業(yè)大學_第1頁
面向?qū)ο蟪绦蛟O(shè)計知到智慧樹期末考試答案題庫2025年齊魯工業(yè)大學_第2頁
面向?qū)ο蟪绦蛟O(shè)計知到智慧樹期末考試答案題庫2025年齊魯工業(yè)大學_第3頁
面向?qū)ο蟪绦蛟O(shè)計知到智慧樹期末考試答案題庫2025年齊魯工業(yè)大學_第4頁
面向?qū)ο蟪绦蛟O(shè)計知到智慧樹期末考試答案題庫2025年齊魯工業(yè)大學_第5頁
已閱讀5頁,還剩11頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

面向?qū)ο蟪绦蛟O(shè)計知到智慧樹期末考試答案題庫2025年齊魯工業(yè)大學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.()

答案:錯Usingtheprotectedkeywordalsogivesamember:()

答案:packageaccess.TypesinJavaaredividedintotwocategories.Theprimitivetypesareboolean,byte,char,short,int,long,floatanddouble.Allothertypesare________types.()

答案:referenceTodeclareamethodasstatic,placethekeywordstaticbefore________inthemethod’sdeclaration.()

答案:thereturntypeThestaticmethod________ofclassStringreturnsaformattedString.()

答案:format.Thenumberofargumentsinthemethodcallmustmatchthenumberofparametersinthemethoddeclaration’sparameterlist.()

答案:對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.()

答案:對Programsremembernumbersandotherdatainthecomputer'smemoryandaccessthatdatathroughprogramelementscalled()

答案:variables.Primitive-typelocalvariablesareinitializedbydefault.()

答案:錯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.()

答案:錯EveryobjectinJavaknowsitsownclassandcanaccessthisinformationthroughmethod.()

答案:getClass.Everymethod’sbodyisdelimitedbyleftandrightbraces({and}).()

答案:對EveryclassinJava,except________,extendsanexistingclass.()

答案:Object.End-of-linecommentsthatshouldbeignoredbythecompileraredenotedusing()

答案:Twoforwardslashes(//).Emptyparenthesesfollowingamethodnameinamethoddeclarationindicatethatthemethoddoesnotrequireanyparameterstoperformitstask.()

答案:對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.()

答案:錯Attemptingtoaccessanarrayelementoutsideoftheboundsofanarray,causesa(n).()

答案:ArrayIndexOutOfBoundsException.Assigningasubclassreferencetoasuperclassvariableissafe________.()

答案:becausethesubclassobjectisanobjectofitssuperclass.Arraysare________.()

答案:fixed-lengthentitiesAnyclassthatcontainspublicstaticvoidm

溫馨提示

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

評論

0/150

提交評論