




版權(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 幫會(huì)搶親活動(dòng)方案
- 布丁店開(kāi)業(yè)活動(dòng)方案
- 工匠頒獎(jiǎng)活動(dòng)方案
- 市發(fā)改委宣教活動(dòng)方案
- 布藝拼貼活動(dòng)方案
- 小生活甲蟲(chóng)活動(dòng)方案
- 工廠朗讀活動(dòng)方案
- 小班故事分享活動(dòng)方案
- 布置貨架活動(dòng)方案
- 師生捐贈(zèng)活動(dòng)方案
- 道路工程制圖與識(shí)圖課件:識(shí)讀公路路線工程圖
- 碳匯效益評(píng)估體系-深度研究
- 初級(jí)無(wú)機(jī)化學(xué)反應(yīng)生產(chǎn)工職業(yè)技能鑒定理論考試題庫(kù)(含答案)
- 體育培訓(xùn)協(xié)議合同范本
- 2025年離婚協(xié)議紙質(zhì)模板電子版
- 2024-2025學(xué)年度第一學(xué)期七年級(jí)英語(yǔ)期末試卷
- 2025年春新北師大版數(shù)學(xué)一年級(jí)下冊(cè)課件 綜合實(shí)踐 設(shè)計(jì)教室裝飾圖
- 2025年陜西延長(zhǎng)石油集團(tuán)礦業(yè)公司招聘筆試參考題庫(kù)含答案解析
- 廣東省茂名市2023-2024學(xué)年高一下學(xué)期7月期末考試 政治 含解析
- 2025-2030年中國(guó)氯化聚醚行業(yè)市場(chǎng)現(xiàn)狀分析及前景趨勢(shì)調(diào)研報(bào)告
- 2023-2024學(xué)年人教(新起點(diǎn))英語(yǔ)四年級(jí)下冊(cè)期末綜合素質(zhì)模擬測(cè)試題(含答案含聽(tīng)力原文)
評(píng)論
0/150
提交評(píng)論