面向?qū)ο蟪绦蛟O(shè)計(jì)智慧樹(shù)知到期末考試答案章節(jié)答案2024年齊魯工業(yè)大學(xué)_第1頁(yè)
面向?qū)ο蟪绦蛟O(shè)計(jì)智慧樹(shù)知到期末考試答案章節(jié)答案2024年齊魯工業(yè)大學(xué)_第2頁(yè)
面向?qū)ο蟪绦蛟O(shè)計(jì)智慧樹(shù)知到期末考試答案章節(jié)答案2024年齊魯工業(yè)大學(xué)_第3頁(yè)
面向?qū)ο蟪绦蛟O(shè)計(jì)智慧樹(shù)知到期末考試答案章節(jié)答案2024年齊魯工業(yè)大學(xué)_第4頁(yè)
面向?qū)ο蟪绦蛟O(shè)計(jì)智慧樹(shù)知到期末考試答案章節(jié)答案2024年齊魯工業(yè)大學(xué)_第5頁(yè)
已閱讀5頁(yè),還剩8頁(yè)未讀 繼續(xù)免費(fèi)閱讀

付費(fèi)下載

下載本文檔

版權(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ì)智慧樹(shù)知到期末考試答案+章節(jié)答案2024年齊魯工業(yè)大學(xué)Whichsuperclassmembersareinheritedbyallsubclassesofthatsuperclass?()

答案:protectedinstancevariablesandmethods.Inarrayitems,whichexpressionbelowaccessesthevalueatrow3andcolumn4?()

答案:items[3][4]WhichofthefollowingisnotapackageintheJavaAPI?()

答案:ponentWhichexpressionadds1totheelementofarrayarrayNameatindexi?()

答案:++arrayName[i].GiventheJavastatementnumber1=input.nextInt();inwhichnumber1isanintandinputisaScanner,whichofthefollowingoccursiftheuserdoesnotenteravalidintvalue?()

答案:Aruntimelogicerroroccurs.WhichstatementcorrectlypassesthearrayitemstomethodtakeArray?Arrayitemscontains10elements.()

答案:takeArray(items).Whichofthefollowingstatementsdescribesblockscope?()

答案:Itbeginsattheidentifier'sdeclarationandendsattheterminatingrightbrace(}).Whichofthefollowingwillnotproduceacompilererror?()

答案:Changingthevalueatagivenindexofanarrayafteritiscreated.Allofthefollowingmethodsareimplicitlyfinalexcept:()

答案:amethodinanabstractclass.Thecontrolvariableofacounter-controlledloopshouldbedeclaredas________topreventerrors.()

答案:intWhichofthefollowingstatementsabouttheconditionaloperator(?:)isfalse?()

答案:Thesecondoperandistheresultvalueiftheconditionevaluatestofalse.Whichofthefollowingcodesegmentsdoesnotincrementvalby3:()

答案:c=3;val=val+(c==3?2:3);ThefilenameforthepublicclassthatbeginswithpublicclassAdditionmustbe()

答案:Addition.java.Whichofthefollowingstatementsis?()

答案:Variablesoftypefloatrepresentdouble-precisionfloating-pointnumbers;theserequiretwiceasmuchmemoryasdoublevariables.Whichofthefollowingescapesequencesrepresentsacarriagereturn?()

答案:\r.Methodcallscannotbedistinguishedby________.()

答案:returntypeInanactivitydiagram,themergesymbolhasthesameshapeaswhatothersymbol?()

答案:Decisionsymbol.InJavaSE7andearlier,aninterfacemaycontain:()

答案:publicstaticfinaldataandpublicabstractmethods.WhichofthefollowingisnotatypeofrepetitionstatementinJava?()

答案:loopstatement.Compositionissometimesreferredtoasa(n)________.()

答案:has-arelationshipAconstructorcannot:()

答案:specifyreturntypesorreturnvalues.Animportdeclarationisnotrequiredifyoualwaysrefertoaclasswithits________name,whichincludesitspackagenameandclassname.()

答案:fullyqualifiednameProgramsremembernumbersandotherdatainthecomputer'smemoryandaccessthatdatathroughprogramelementscalled()

答案:variables.Anoverloadedmethodisonethat________.()

答案:hasthesamenameasanothermethod,butdifferentparameters(bynumber,typesororderofthetypes)ClassArraysmethodssort,binarySearch,equalsandfillareoverloadedforprimitive-typearraysandObjectarrays.Inaddition,methods__________and__________areoverloadedwithgenericversions.()

答案:binarySearch,equals.Whichofthefollowingwouldnotbeusedtoclarifyadangling-else?()

答案:Parentheses().

答案:Both(a)and(b)aretrue.Whichofthefollowingstatementscreatesamultidimensionalarraywith3rows,wherethefirstrowcontains1element,thesecondrowcontains4elementsandthefinalrowcontains2elements?()

答案:int[][]items={{1},{2,3,4,5},{6,7}};Whichofthefollowingwillcountdownfrom10to1correctly?()

答案:for(intj=10;j>=1;j--)Primitive-typelocalvariablesareinitializedbydefault.()

答案:錯(cuò)Animportdeclarationisnotrequiredwhenoneclassinapackageusesanotherinthesamepackage.()

答案:對(duì)Everymethod’sbodyisdelimitedbyleftandrightbraces({and}).()

答案:對(duì)Byconvention,methodnamesbeginwithanuppercasefirstletter,andallsubsequentwordsinthenamebeginwithacapitalfirstletter.()

答案:錯(cuò)Whichofthefollowingclassmembersshouldusuallybeprivate?()

答案:Variables(orfields).Whichofthefollowingoperatorsassociatesfromlefttoright?()

答案:/Forthearraythatwasthecorrectanswerinthepreviousquestion,whatisthevaluereturnedbyitems[1][0]?()

答案:6.

答案:AllfourmethodsareoverloadedClassArraysprovidesmethod__________forcomparingarraystodeterminewhethertheyhavethesamecontents.()

答案:equalsWhenanobjectisconcatenatedwithaString,________.()

答案:theobject’stoStringmethodisimplicitlycalledtoobtaintheStringrepresentationoftheobject

答案:Noneoftheabove.Whichofthefollowingstatementsisfalse?()

答案:Usetheaccessmodifierpackagetogiveamethodorvariablepackageaccess.Whichofthefollowingprimitivetypesisneverpromotedtoanotherprimitivetype?()

答案:Bothaandc.Whichoperatorcanbeusedinstringconcatenation?()

答案:+=Declaringinstancevariables________isknownasdatahidingorinformationhiding.()

答案:privateWhichofthefollowingdoesnotcompletethesentencecorrectly?Interface______.()

答案:canbeinstantiated.Portionsofstatementsthatcontaincalculationsarecalled()

答案:expressions.

答案:Thisporridgeistoohot!Thisporridgeisjustright!Counter-controlledrepetitionisalsoknownas:()

答案:DefiniterepetitionAttemptingtoaccessanarrayelementoutsideoftheboundsofanarray,causesa(n).()

答案:ArrayIndexOutOfBoundsException.Anargumenttypefollowedbya(n)_______inamethod’sparameterlistindicatesthatthemethodreceivesavariablenumberofargumentsofthatparticulartype.()

答案:ellipsis(...)Havingathisreferenceallows:()

答案:Alloftheabove.Whenmethodprintfrequiresmultiplearguments,theargumentsareseparatedwith________.()

答案:commas(,).WhichofthefollowingisnotaJavaprimitivetype?()

答案:realWhichofthefollowingstatementsistrue?()

答案:Alloftheabovearetrue.Thestaticmethod________ofclassStringreturnsaformattedString.()

答案:format.IdentifiersinJavahave________and________scopes?()

答案:class,block.Whichofthefollowingwillnothelppreventinfiniteloops?()

答案:Includebracesaroundthestatementsinado…whilestatement.Polymorphismallowsforspecificstobedealtwithduring:()

答案:execution.Inanexpressioncontainingvaluesofthetypesintanddouble,the________valuesare________to________valuesforuseintheexpression.()

答案:int,promoted,double.Whichofthefollowingpromotionsofprimitivetypesisnotallowedtooccur?()

答案:doubletofloat.Whichofthesestatementsbestdefinesscope?()

答案:Scopeistheportionofaprogramthatcanrefertoanentitybyitssimplename.A(n)________indicatesaproblemthatoccurswhileaprogramexecutes.()

答案:exceptionTheformatspecifier%.2fspecifiesthattwodigitsofprecisionshouldbeoutput________inthefloating-pointnumber.()

答案:totherightofthedecimalpointWhichstatementbestdescribestherelationshipbetweensuperclassandsubclasstypes?()

答案:Asubclassreferencecanbeassignedtoasuperclassvariable,butasuperclassreferencecannotbeassignedtoasubclassvariable.Localvariablesmustbe________.()

答案:initializedbeforetheirvaluesareusedinanexpression.Whenasubclassconstructorcallsitssuperclassconstructor,whathappensifthesuperclass’sconstructordoesnotassignavaluetoaninstancevariable?()

答案:Theprogramcompilesandrunsbecausetheinstancevariablesareinitializedtotheirdefaultvalues.Sentinel-controlledrepetitionisalsoknownas________.()

答案:IndefiniterepetitionInvalidpossibilitiesforarrayindicesinclude.()

答案:Negativeintegers.Whatistheresultvalueofcattheendofthefollowingcodesegment?intc=8;c++;++c;c%=5;()

答案:0.Wherecanlocalvariablesdeclaredwithinamethod’sbodybeused?()

答案:Onlyinthatmethodbetweenthelineinwhichtheyweredeclaredandtheclosingbraceofthatmethod.Whichofthefollowingisnotpossible?()

答案:Aclassthatinheritsfromtwoclasses.Staticclassvariables:()

答案:aresharedbyallobjectsofaclass.Whichstatementistruewhenasuperclasshasprotectedinstancevariables?()

答案:Alloftheabove.WhichcommandbelowrunsTestProgram,andpassesinthevaluesfiles.txtand3?()

答案:javaTestProgramfiles.txt3.Whichexpressionisequivalenttoif(!(grade==sentinelValue))?()

答案:if(grade!=sentinelValue)EveryobjectinJavaknowsitsownclassandcanaccessthisinformationthroughmethod.()

答案:getClass.Assigningasubclassreferencetoasuperclassvariableissafe________.()

答案:becausethesubclassobjectisanobjectofitssuperclass.Whichofthefollowingstatementsaboutabstractsuperclassesistrue?()

答案:abstractsuperclassesmaycontaindata.Whenasuperclassvariablereferstoasubclassobjectandamethodiscalledonthatobject,theproperimplementationisdeterminedatexecutiontime.Whatistheprocessofdeterminingthecorrectmethodtocall?()

答案:latebinding.A(n)_____classcannotbeinstantiated.()

答案:abstract.Classesandmethodsaredeclaredfinalforallbutthefollowingreasons:()

答案:finalmethodsarestatic.Whichofthefollowingcouldbeusedtodeclareabstractmethodmethod1inabstractclassClass1(method1returnsanintandtakesnoarguments)?()

答案:publicabstractintmethod1();ConsiderclassesA,BandC,whereAisanabstractsuperclass,BisaconcreteclassthatinheritsfromAandCisaconcreteclassthatinheritsfromB.ClassAdeclaresabstractmethodoriginalMethod,implementedinclassB.WhichofthefollowingstatementsistrueofclassC?()

答案:Noneoftheabove.Non-abstractclassesarecalled________.()

答案:concreteclasses.Ifthesuperclasscontainsonlyabstractmethoddeclarations,thesuperclassisusedfor________.()

答案:interfaceinheritance.Anadvantageofinheritanceisthat:()

答案:Objectsofasubclasscanbetreatedlikeobjectsoftheirsuperclass.Superclassmethodswiththislevelofaccesscannotbecalledfromsubclasses.()

答案:private.Usingtheprotectedkeywordalsogivesamember:()

答案:packageaccess.Inheritanceisalsoknownasthe()

答案:is-arelationship.Whichofthefollowingkeywordsallowsasubclasstoaccessasuperclassmethodevenwhenthesubclasshasoverriddenthesuperclassmethod?()

答案:super.Overridingamethoddiffersfromoverloadingamethodbecause:()

答案:Overriddenmethodshavethesamesignature.Whichofthefollowingisnotasuperclass/subclassrelationship?()

答案:Sailboat/Tugboat.EveryclassinJava,except________,extendsanexistingclass.()

答案:Object.Whichofthefollowinginitializerlistswouldcorrectlysettheelementsofarrayn?()

答案:int[]n={1,2,3,4,5};Whichstatementcreatesarandomvaluefromthesequence2,5,8,11and14.SupposerandomNumbersisaSecureRandomobject.()

答案:2+3*randomNumbers.nextInt(5);Whichofthefollowingstatementsaboutcreatingarraysandinitializingtheirelementsisfalse?()

答案:Theelementsofanarrayofintegershaveavalueofnullbeforetheyareinitialized.Whichofthefollowingstatementsaboutarraysaretrue?1:Anarrayisagroupofvariablescontainingvaluesthatallhavethesametype.2:Elementsarelocatedbyindex.3:Thelengthofanarraycisdeterminedbytheexpressionc.length();4:Thezerothelementofarraycisspecifiedbyc[0].()

答案:1,2,4Aprogrammermustdothefollowingbeforeusinganarray:()

答案:declarethencreatethearray.Arraysare________.()

答案:fixed-lengthentitiesAsetofnamedconstantsthatstartwiththevalue0forthefirstconstantandincrementby1foreachsubsequentconstantcanbedeclaredasa(n)________.()

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

答案:referenceMathstaticmethodrandomgeneratesarandomdoublevalueintherangefrom0.0()

答案:uptobutnotincluding1.0Considerthecodesegmentbelow.Whichofthefollowingstatementsisfalse?int[]g;g=newint[23];()

答案:Thevalueofg[3]is-1.Todeclareamethodasstatic,placethekeywordstaticbefore________inthemethod’sdeclaration.()

答案:thereturntypeInformationispassedtoamethodin________.()

答案:theargumentstothemethodAwell-designedmethod________.()

答案:performsasingle,well-definedtaskWhichofthefollowingmethodsisnotintheMathclass?()

答案:parseIntAnyclassthatcontainspublicstaticvoidmain(String[]args)canbeusedtoexecuteanapp.()

答案:對(duì)WhichisacorrectstaticmethodcallofMathclassmethodsqrt?()

答案:Math.sqrt(900);Reference-typeinstancevariablesareinitializedbydefaulttothevaluenull.()

答案:對(duì)Aprimitive-typevariablecanbeusedtoinvokeamethod.()

答案:錯(cuò)Emptyparenthesesfollowingamethodnameinamethoddeclarationindicatethatthemethoddoesnotrequireanyparameterstoperformitstask.()

答案:對(duì)Variablesdeclaredinthebodyofaparticularmethodareknownasinstancevariablesandcanbeusedinallmethodsoftheclass.()

答案:錯(cuò)Whenamethodterminates,thevaluesofitslocalvariablesare________.()

答案:lostFloating-pointvaluesthatappearinsourcecodeareknownasfloating-pointliteralsandaretypefloatbydefault.()

答案:錯(cuò)Eachclassyoucreatebecomesanew________thatcanbeusedtodeclarevariablesandcreateobjects.()

答案:type.Thenumberofargumentsinthemethodcallmustmatchthenumberofparametersinthemethoddeclaration’sparameterlist.()

答案:對(duì)Whichofthefollowingisnotacontrolstructure:()

答案:Declarationstructure.Whichofthefollowingisnotacompilationerror?()

答案:Placingasemicolonattheendofthefirstlineofanifstatement.Whichofthefollowingstatementsdoesnotalterthevaluestoredinamemorylocation?()

答案:inta;Optionalparenthesesinexpressionsaresaidtobe()

答案:redundant.Eachofthefollowingisarelationalorequalityoperatorexcept:()

答案:=!Whichofthefollowingisadouble-selectioncontrolstatement?()

答案:if…elseWhichofthefollowingcanbeusedinaswitchstatementintheexpressionafterkeywordcase?a.aconstantinteg

溫馨提示

  • 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)論