A.ifline10isremoved,thecompilationsucceeds.
B.ifline11isremoved,thecompilationsucceeds.
C.ifline12isremoved,thecompilationsucceeds.
D.ifline13isremoved,thecompilationsucceeds.
E.Morethanonelinemustberemovedforcompilationtosucceed.
![](https://lstatic.shangxueba.com/sxbcn/h5/images/tips_org.png)
A.ifline10isremoved,thecompilationsucceeds.
B.ifline11isremoved,thecompilationsucceeds.
C.ifline12isremoved,thecompilationsucceeds.
D.ifline13isremoved,thecompilationsucceeds.
E.Morethanonelinemustberemovedforcompilationtosucceed.
第1题
A.CompilationfailsbecausethehashCodemethodisnotoverridden.
B.AHashSetcouldcontainmultiplePersonobjectswiththesamename.
C.AllPersonobjectswillhavethesamehashcodebecausethehashCodemethodisnotoverridden.
D.IfaHashSetcontainsmorethanonePersonobjectwithname=”Fred”,thenremovinganother person,alsowithname=”Fred”,willremovethemall.
第2题
A.Thecodewillcompilewithoutchanges.
B.ThecodewillcompileifpublicTree(){Plant();}isaddedtotheTreeclass.
C.ThecodewillcompileifpublicPlant(){Tree();}isaddedtothePlantclass.
D.ThecodewillcompileifpublicPlant(){this(”fern”);}isaddedtothePlantclass.
E.ThecodewillcompileifpublicPlant(){Plant(”fern”);}isaddedtothePlantclass.
第3题
A.ThecurrentconnectionsarereroutedviathebackupGSS
B.SecondaryGSScannotbeusedtoconfiguretheGSScluster
C.AllremainingGSSsintheclustercontinuerespondingtoanynewqueries
D.AllrecordsintheGSSdatabaseareflushedandreconstructedagainusinganewmasterGSS
第4题
A.Theclassisfullyencapsulated.
B.Thecodedemonstratespolymorphism.
C.TheownerNamevariablebreaksencapsulation.
D.ThecardlDandlimitvariablesbreakpolymorphism.
E.ThesetCardlnformationmethodbreaksencapsulation.
第6题
A.ThiscodeisNOTthread-safe.
B.TheprogrammercanreplaceStringBufferwithStringBuilderwithnootherchanges.
C.ThiscodewillperformwellandconvertingthecodetouseStringBuilderwillnotenhancetheperformance.
D.Thiscodewillperformpoorly.Forbetterperformance,thecodeshouldberewritten:return“<“+this.name+“>”;
第7题
A.Line 57 will print the value 2.
B.Line 57 will print the value 3.
C.Compilation will fail because of an error in line 55.
D.Compilation will fail because of an error in line 56.
第8题
A.TheequalsmethoddoesNOTproperlyoverridetheObject.equalsmethod.
B.Compilationfailsbecausetheprivateattributep.namecannotbeaccessedinline5.
C.Toworkcorrectlywithhash-baseddatastructures,thisclassmustalsoimplementthehashCodemethod.
D.WhenaddingPersonobjectstoajava.util.Setcollection,theequalsmethodinline4willpreventduplicates.
第9题
A.Compilationfails.
B.Anexceptionisthrownatruntime.
C.Synchronizingtherun()methodwouldmaketheclassthread-safe.
D.Thedatainvariable“x”areprotectedfromconcurrentaccessproblems.
E.DeclaringthedoThings()methodasstaticwouldmaketheclassthread-safe.
F.WrappingthestatementswithindoThings()inasynchronized(newObject()){}blockwouldmaketheclassthread-safe.
第10题
A.ThiscodemaythrowanInterruptedException.
B.ThiscodemaythrowanIllegalStateException.
C.ThiscodemaythrowaTimeoutExceptionaftertenminutes.
D.Thiscodewillnotcompileunless“obj.wait()”isreplacedwith“((Thread)obj).wait()”.
E.Reversingtheorderofobj.wait()andobj.notify()maycausethismethodtocompletenormally.
F.Acalltonotify()ornotifyAll()fromanotherthreadmaycausethismethodtocompletenormally.
第11题
A.Thevaluereturnedneedstobecasttoanint.
B.ThegetAttributemethostakestwoarguments.
C.PrimitiveCANNOTbestoredintheHttpSession.
D.TheHttpSessionattributenamemustNOTexceedeightcharacters.
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!