面向?qū)ο蟪绦蛟O(shè)計智慧樹知到課后章節(jié)答案2023年下齊魯工業(yè)大學(xué)_第1頁
面向?qū)ο蟪绦蛟O(shè)計智慧樹知到課后章節(jié)答案2023年下齊魯工業(yè)大學(xué)_第2頁
面向?qū)ο蟪绦蛟O(shè)計智慧樹知到課后章節(jié)答案2023年下齊魯工業(yè)大學(xué)_第3頁
面向?qū)ο蟪绦蛟O(shè)計智慧樹知到課后章節(jié)答案2023年下齊魯工業(yè)大學(xué)_第4頁
面向?qū)ο蟪绦蛟O(shè)計智慧樹知到課后章節(jié)答案2023年下齊魯工業(yè)大學(xué)_第5頁
已閱讀5頁,還剩20頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

面向?qū)ο蟪绦蛟O(shè)計智慧樹知到課后章節(jié)答案2023年下齊魯工業(yè)大學(xué)齊魯工業(yè)大學(xué)

第一章測試

WhicheditionofJavaisgearedtowarddevelopinglarge-scale,distributednetworkingapplicationsandweb-basedapplications?()

A:StandardEdition.

B:MicroEdition.

C:IndustrialEdition.

D:EnterpriseEdition.

答案:EnterpriseEdition.

Javawasoriginallydevelopedfor:()

A:Intelligentconsumerdevices.

B:Distributedcomputing.

C:Personalcomputers.

D:Operatingsystemsdevelopment.

答案:Intelligentconsumerdevices.

WhichofthefollowingstatementsaboutJavaClassLibrariesisfalse:()

A:Javaclasslibrariesconsistofclassesthatconsistofmethodsthatperformtasks.

B:JavaclasslibrariesarealsoknownasJavaAPIs(ApplicationProgrammingInterfaces).

C:Javaclasslibrariesarenotportable

D:AnadvantageofusingJavaclasslibrariesissavingtheeffortofdesigning,developingandtestingnewclasses.

答案:Javaclasslibrariesarenotportable

The.classextensiononafilemeansthatthefile:()

A:isproducedbytheJavacompiler(javac).

B:Noneoftheabove.

C:Containsjavasourcecode

D:ContainsHTML

答案:isproducedbytheJavacompiler(javac).

Thecommand________executesaJavaapplication.()

A:java

B:Noneoftheabove

C:javac

D:run

答案:java

第二章測試

End-of-linecommentsthatshouldbeignoredbythecompileraredenotedusing()

A:Threeforwardslashes(///).

B:Twoforwardslashes(//).

C:Aslashandtwostars(/**).

D:Aslashandastar(/*).

答案:Twoforwardslashes(//).

WhichofthefollowingisnotavalidJavaidentifier?()

A:m_x

B:width

C:$_AAA1

D:myValue

答案:myValue

WhichofthefollowingcannotcauseasyntaxerrortobereportedbytheJavacompiler?()

A:Missing*/inacommentthatbeginswith/*

B:Mismatched{}

C:Anextrablankline.

D:Missing;

答案:Anextrablankline.

WhichcommandcompilestheJavasourcecodefileWelcome.java?()

A:cdWelcome.java

B:javaWelcome.java

C:javacWelcome.java

D:compileWelcome.java

答案:javacWelcome.java

WhichcommandexecutestheJavaclassfileWelcome.class?()

A:runWelcome.class

B:javaWelcome

C:javaWelcome.class

D:javawelcome

答案:javaWelcome

Whichistheoutputofthefollowingstatements?

()

A:HelloWorld

B:HelloWorld

C:WorldHello

D:HelloWorld

答案:HelloWorld

Whichstatementprintsthefloating-pointvalue123.456rightjustifiedwithafieldwidthof10?()

A:System.out.printf("%10.3f",123.456);

B:System.out.printf("%f10.3",123.456);

C:System.out.printf("%10.3d",123.456);

D:System.out.printf("%d10.3",123.456);

答案:System.out.printf("%10.3f",123.456);

Whatisthesizeinbitsofanint?()

A:16

B:32

C:64

D:8

答案:32

Whichofthefollowingistheescapecharacter?()

A:

B:*

C:"

D:

答案:\

第三章測試

Whichofthefollowingcanbeusedinaswitchstatementintheexpressionafterkeywordcase?a.aconstantintegralexpression.b.acharacterconstant.c.aStringd.anenumerationconstant.()

A:aandb.

B:aandc

C:bandc

D:All.

答案:All.

Optionalparenthesesinexpressionsaresaidtobe()

A:implied.

B:redundant.

C:binaryoperators.

D:declared.

答案:redundant.

Whichofthefollowingstatementsdoesnotalterthevaluestoredinamemorylocation?()

A:width=Integer.parseInt(input);

B:number=12;

C:inta;

D:y=y+2;

答案:inta;

WhatisthevalueofresultafterthefollowingJavastatementsexecute(assumeallvariablesareoftypeint)?

()

A:127

B:59

C:119

D:51

答案:119

Whichofthefollowingisnotanarithmeticoperator?()

A:.

B:+

C:-

D:%

答案:.

Whichofthefollowingisnotacompilationerror?()

A:Allarecompilationerrors.

B:Placingasemicolonattheendofthefirstlineofanifstatement.

C:Omittingtheleftandrightparenthesisfortheconditionofanifstatement.

D:Neglectingtoinitializealocalvariableinamethodbeforeitisused.

答案:Placingasemicolonattheendofthefirstlineofanifstatement.

Eachofthefollowingisarelationalorequalityoperatorexcept:()

A:==

B:<=

C:=!

D:>

答案:=!

Whichofthefollowingisnotacontrolstructure:()

A:Declarationstructure.

B:Selectionstructure.

C:Sequencestructure.

D:Repetitionstructure.

答案:Declarationstructure.

Whichofthefollowingisadouble-selectioncontrolstatement?()

A:for

B:if

C:do…while

D:if…else

答案:if…else

第四章測試

Thenumberofargumentsinthemethodcallmustmatchthenumberofparametersinthemethoddeclaration’sparameterlist.()

A:對B:錯

答案:對

Floating-pointvaluesthatappearinsourcecodeareknownasfloating-pointliteralsandaretypefloatbydefault.()

A:錯B:對

答案:錯

Eachclassyoucreatebecomesanew________thatcanbeusedtodeclarevariablesandcreateobjects.()

A:library

B:type.

C:package

D:instance

答案:type.

Whichofthefollowingstatementsisfalse?()

A:Everyclassdeclarationcontainskeywordclassfollowedimmediatelybytheclass’sname.

B:Eachclassdeclarationthatbeginswiththeaccessmodifierprivatemustbestoredinafilethathasthesamenameastheclassandendswiththe.javafilenameextension.

C:Class,methodandvariablenamesareidentifiers.

D:Anobjecthasattributesthatareimplementedasinstancevariablesandcarriedwithitthroughoutitslifetime.

答案:Eachclassdeclarationthatbeginswiththeaccessmodifierprivatemustbestoredinafilethathasthesamenameastheclassandendswiththe.javafilenameextension.

Whichofthefollowingstatementsisfalse?()

A:Instancevariablescanbedeclaredanywhereinsideaclass.

B:Aclassnormallycontainsoneormoremethodsthatmanipulatetheinstancevariablesthatbelongtoparticularobjectsoftheclass.

C:Byconventionclassnamesbeginwithanuppercaseletter,andmethodandvariablenamesbeginwithalowercaseletter.

D:Instancevariablesexistbeforemethodsarecalledonanobject,whilethemethodsareexecutingandafterthemethodscompleteexecution.

答案:Instancevariablescanbedeclaredanywhereinsideaclass.

Whichofthefollowingstatementsistrue?()

A:Eachobject(instance)oftheclasssharestheclass’sinstancevariables.

B:Mostinstance-variabledeclarationsareprecededwiththekeywordpublic,whichisanaccessmodifier.

C:Noneoftheaboveistrue.

D:Variablesormethodsdeclaredwithaccessmodifierprivateareaccessibleonlytomethodsoftheclassinwhichthey’redeclared.

答案:Variablesormethodsdeclaredwithaccessmodifierprivateareaccessibleonlytomethodsoftheclassinwhichthey’redeclared.

Whenamethodterminates,thevaluesofitslocalvariablesare________.()

A:saved

B:restored

C:copied

D:lost

答案:lost

Whichofthefollowingstatementsistrue?()

A:Everyinstancevariablehasadefaultinitialvalue—avalueprovidedbyJavawhenyoudonotspecifytheinstancevariable’sinitialvalue.

B:Localvariablesareautomaticallyinitialized.

C:Theargumenttypesinthemethodcallmustbeidenticaltothetypesofthecorrespondingparametersinthemethod’sdeclaration.

D:ThedefaultvalueforaninstancevariableoftypeStringisvoid.

答案:Everyinstancevariablehasadefaultinitialvalue—avalueprovidedbyJavawhenyoudonotspecifytheinstancevariable’sinitialvalue.

Whichofthefollowingstatementsisfalse?()

A:Theasterisk(*)injavac*.javaindicatesthatallfilesinthecurrentdirectoryendingwiththefilenameextension.javashouldbecompiled.

B:Thejavaccommandcancompilemultipleclassesatonce;simplylistthesource-codefilenamesafterthecommandwitheachfilenameseparatedbyacommafromthenext.

C:Ifthedirectorycontainingtheappincludesonlyoneapp’sfiles,youcancompileallofitsclasseswiththecommandjavac*.java.

D:Alloftheabovearetrue.

答案:Thejavaccommandcancompilemultipleclassesatonce;simplylistthesource-codefilenamesafterthecommandwitheachfilenameseparatedbyacommafromthenext.

Whichofthefollowingstatementsisfalse?()

A:PrivateattributesareprecededbythekeywordprivateintheUML.

B:TheUMLmodelsoperationsbylistingtheoperationnamefollowedbyasetofparentheses.Aplussign(+)infrontoftheoperationnameindicatesthattheoperationisapublic.

C:UMLrepresentsinstancevariablesasanattributename,followedbyacolonandthetype.

D:IntheUML,eachclassismodeledinaclassdiagramasarectanglewiththreecompartments.Thetoponecontainstheclass’snamecenteredhorizontallyinboldface.Themiddleonecontainstheclass’sattributes,whichcorrespondtoinstancevariablesinJava.Thebottomonecontainstheclass’soperations,whichcorrespondtomethodsandconstructorsinJava.

答案:PrivateattributesareprecededbythekeywordprivateintheUML.

Emptyparenthesesfollowingamethodnameinamethoddeclarationindicatethatthemethoddoesnotrequireanyparameterstoperformitstask.()

A:錯B:對

答案:對

Aprimitive-typevariablecanbeusedtoinvokeamethod.()

A:對B:錯

答案:錯

Variablesdeclaredinthebodyofaparticularmethodareknownasinstancevariablesandcanbeusedinallmethodsoftheclass.()

A:錯B:對

答案:錯

第五章測試

Reference-typeinstancevariablesareinitializedbydefaulttothevaluenull.()

A:對B:錯

答案:對

Anyclassthatcontainspublicstaticvoidmain(String[]args)canbeusedtoexecuteanapp.()

A:錯B:對

答案:對

Whichofthefollowingstatementsisfalse?()

A:Variablesdeclaredinthebodyofaparticularmethodarelocalvariablesandcanbeusedonlyinthatmethod.

B:Everymethod’sbodyisdelimitedbyleftandrightbraces({and}).

C:Keywordnullindicatesthatamethodwillperformataskbutwillnotreturnanyinformation.

D:Amethod’sparametersarelocalvariablesofthemethod.

答案:Keywordnullindicatesthatamethodwillperformataskbutwillnotreturnanyinformation.

Whichofthefollowingstatementsisfalse?()

A:Whenamethodthatspecifiesareturntypeotherthanvoidiscalledandcompletesitstask,themethodmustreturnaresulttoitscallingmethod

B:Classesoftenprovidepublicmethodstoallowtheclass’sclientstosetorgetprivateinstancevariables;thenamesofthesemethodsmustbeginwithsetorget.

C:Emptyparenthesesfollowingamethodnameindicatethatthemethoddoesnotrequireanyparameterstoperformitstask.

D:Themethod’sreturntypespecifiesthetypeofdatareturnedtoamethod’scaller.

答案:Classesoftenprovidepublicmethodstoallowtheclass’sclientstosetorgetprivateinstancevariables;thenamesofthesemethodsmustbeginwithsetorget.

Whichofthefollowingstatementsisfalse?()

A:Tocallamethodofanobject,followtheobjectnamewithacomma,themethodnameandasetofparenthesescontainingthemethod’sarguments.

B:Aclassinstancecreationexpressionbeginswithkeywordnewandcreatesanewobject.

C:Aconstructorissimilartoamethodbutiscalledimplicitlybythenewoperatortoinitializeanobject’sinstancevariablesatthetimetheobjectiscreated.

D:Scannermethodnextreadscharactersuntilanywhite-spacecharacterisencountered,thenreturnsthecharactersasaString.

答案:Tocallamethodofanobject,followtheobjectnamewithacomma,themethodnameandasetofparenthesescontainingthemethod’sarguments.

Informationispassedtoamethodin________.()

A:themethodname

B:theargumentstothemethod

C:thatmethod’sreturn

D:themethodbody

答案:theargumentstothemethod

Awell-designedmethod________.()

A:repeatscodefoundinothermethods

B:containsthousandsoflinesofcode

C:performsmultipleunrelatedtasks

D:performsasingle,well-definedtask

答案:performsasingle,well-definedtask

Todeclareamethodasstatic,placethekeywordstaticbefore________inthemethod’sdeclaration.()

A:theargumentlist

B:themethodmodifier

C:themethodname

D:thereturntype

答案:thereturntype

WhichisacorrectstaticmethodcallofMathclassmethodsqrt?()

A:sqrt(900);

B:Math.sqrt(900);

C:Mathmath=newMath();math.sqrt(900);

D:math.sqrt(900);

答案:Math.sqrt(900);

WhichofthefollowingmethodsisnotintheMathclass?()

A:log

B:ceil

C:parseInt

D:abs

答案:parseInt

第六章測試

Mathstaticmethodrandomgeneratesarandomdoublevalueintherangefrom0.0()

A:uptobutnotincluding1.0

B:uptobutnotincluding100.0

C:uptoandincluding100.0

D:uptoandincluding1.0

答案:uptobutnotincluding1.0

Whichstatementcreatesarandomvaluefromthesequence2,5,8,11and14.SupposerandomNumbersisaSecureRandomobject.()

A:2+3*randomNumbers.nextInt(5);

B:2+5*randomNumbers.nextInt(3);

C:5+3*randomNumbers.nextInt(2);

D:3+2*randomNumbers.nextInt(5);

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

Asetofnamedconstantsthatstartwiththevalue0forthefirstconstantandincrementby1foreachsubsequentconstantcanbedeclaredasa(n)________.()

A:enum

B:Noneoftheabove.

C:enumeration

D:class

答案:enum

Arraysare________.()

A:usedtodrawasequenceoflines,orrays

B:datastructuresthatcontainupto10relateddataitems

C:fixed-lengthentities

D:variable-lengthentities

答案:fixed-lengthentities

TypesinJavaaredividedintotwocategories.Theprimitivetypesareboolean,byte,char,short,int,long,floatanddouble.Allothertypesare________types.()

A:reference

B:source

C:static

D:declared

答案:reference

Whichofthefollowingstatementsisfalse?()

A:Variablesoftypebooleanareinitializedtotrue.

B:Primitive-typeinstancevariablesareinitializedbydefault.

C:Aprimitive-typevariablecanstoreexactlyonevalueofitsdeclaredtypeatatime.

D:Variablesoftypesbyte,short,int,long,floatanddoubleareinitializedto0.

答案:Variablesoftypebooleanareinitializedtotrue.

Whichofthefollowingstatementsaboutarraysaretrue?

1:Anarrayisagroupofvariablescontainingvaluesthatallhavethesametype.

2:Elementsarelocatedbyindex.

3:Thelengthofanarraycisdeterminedbytheexpressionc.length();

4:Thezerothelementofarraycisspecifiedbyc[0].()

A:3,4

B:1,2,4

C:1,2,3,4

D:1,3,4

答案:1,2,4

Aprogrammermustdothefollowingbeforeusinganarray:()

A:createthendeclarethearray.

B:declarethenreferencethearray.

C:createthenreferencethearray.

D:declarethencreatethearray.

答案:declarethencreatethearray.

Considerthecodesegmentbelow.Whichofthefollowingstatementsisfalse?int[]g;g=newint[23];()

A:Thefirststatementdeclaresanarrayreference.

B:gisareferencetoanarrayofintegers.

C:Thesecondstatementcreatesthearray.

D:Thevalueofg[3]is-1.

答案:Thevalueofg[3]is-1.

Whichofthefollowingstatementsaboutcreatingarraysandinitializingtheirelementsisfalse?()

A:Whenanarrayiscreatedwithoperatornew,thenumberofelementsmustbeplacedinsquarebracketsfollowingthetypeofelementbeingstored.

B:Thenewkeywordshouldbeusedtocreateanarray.

C:Theelementsofanarrayofintegershaveavalueofnullbeforetheyareinitialized.

D:Aforloopiscommonlyusedtosetthevaluesoftheelementsofanarray.

答案:Theelementsofanarrayofintegershaveavalueofnullbeforetheyareinitialized.

Whichofthefollowinginitializerlistswouldcorrectlysettheelementsofarrayn?()

A:intn[5]={1;2;3;4;5};

B:arrayn[int]={1,2,3,4,5};

C:int[]n={1,2,3,4,5};

D:intn=newint(1,2,3,4,5);

答案:int[]n={1,2,3,4,5};

第七章測試

Whichofthefollowingstatementsisfalse?()

A:Theclassfollowingtheextendskeywordinaclassdeclarationisthedirectsuperclassoftheclassbeingdeclared.

B:Asuperclassobjectisasubclassobject.

C:Asubclassisoftenlargerthanitssuperclass.

D:Javausesinterfacestoprovidethebenefitsofmultipleinheritance.

答案:Asuperclassobjectisasubclassobject.

Inheritanceisalsoknownasthe()

A:uses-arelationship.

B:knows-arelationship.

C:has-arelationship.

D:is-arelationship.

答案:is-arelationship.

Whichofthefollowingisnotasuperclass/subclassrelationship?()

A:Noneoftheabove.

B:Vehicle/Car.

C:Employee/HourlyEmployee.

D:Sailboat/Tugboat.

答案:Sailboat/Tugboat.

Anadvantageofinheritanceisthat:()

A:Objectsofasubclasscanbetreatedlikeobjectsoftheirsuperclass.

B:Allmethodscanbeinherited.

C:Noneoftheabove.

D:Allinstancevariablescanbeuniformlyaccessedbysubclassesandsuperclasses.

答案:Objectsofasubclasscanbetreatedlikeobjectsoftheirsuperclass.

Whichofthefollowingkeywordsallowsasubclasstoaccessasuperclassmethodevenwhenthesubclasshasoverriddenthesuperclassmethod?()

A:this.

B:base.

C:super.

D:public.

答案:super.

Usingtheprotectedkeywordalsogivesamember:()

A:privateaccess.

B:packageaccess.

C:publicaccess.

D:blockscope.

答案:packageaccess.

Superclassmethodswiththislevelofaccesscannotbecalledfromsubclasses.()

A:package.

B:private.

C:public.

D:protected.

答案:private.

EveryclassinJava,except________,extendsanexistingclass.()

A:Integer.

B:Object.

C:String.

D:Class.

答案:Object.

Overridingamethoddiffersfromoverloadingamethodbecause:()

A:Neitheroftheabove.

B:Overloadedmethodshavethesamesignature.

C:Overriddenmethodshavethesamesignature.

D:Bothoftheabove.

答案:Overriddenmethodshavethesamesignature.

第八章測試

A(n)_____classcannotbeinstantiated.()

A:final.

B:concrete.

C:abstract.

D:polymorphic.

答案:abstract.

Non-abstractclassesarecalled________.()

A:realclasses.

B:implementableclasses.

C:concreteclasses.

D:instanceclasses.

答案:concreteclasses.

Ifthesuperclasscontainsonlyabstractmethoddeclarations,thesuperclassisusedfor________.()

A:Both.

B:Neither.

C:implementationinheritance.

D:interfaceinheritance.

答案:interfaceinheritance.

Whichofthefollowingcouldbeusedtodeclareabstractmethodmethod1inabstractclassClass1(method1returnsanintandtakesnoarguments)?()

A:publicintabstractmethod1();

B:publicintnonfinalmethod1();

C:publicintmethod1();

D:publicabstractintmethod1();

答案:publicabstractintmethod1();

Whichofthefollowingstatementsaboutabstractsuperclassesistrue?()

A:abstractsuperclassesmustdeclareallmeth

溫馨提示

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

最新文檔

評論

0/150

提交評論