A.ThecurrentconnectionsarereroutedviathebackupGSS
B.SecondaryGSScannotbeusedtoconfiguretheGSScluster
C.AllremainingGSSsintheclustercontinuerespondingtoanynewqueries
D.AllrecordsintheGSSdatabaseareflushedandreconstructedagainusinganewmasterGSS
第1题:
classClassA{publicintnumberOfinstances;protectedClassA(intnumberOfinstances){this.numberOflnstances=numberOfinstances;}}publicclassExtendedAextendsClassA{privateExtendedA(intnumberOfinstances){super(numberOflnstances);}publicstaticvoidmain(String[]args){ExtendedAext=newExtendedA(420);System.out.print(ext.numberOflnstances);}}Whichistrue?()
A.420istheoutput.
B.Anexceptionisthrownatruntime.
C.Allconstructorsmustbedeclaredpublic.
D.ConstructorsCANNOTusetheprivatemodifier.
E.ConstructorsCANNOTusetheprotectedmodifier.
第2题:
A.ThiscodemaythrowanInterruptedException.
B.ThiscodemaythrowanIllegalStateException.
C.ThiscodemaythrowaTimeoutExceptionaftertenminutes.
D.Thiscodewillnotcompileunless“obj.wait()”isreplacedwith“((Thread)obj).wait()”.
E.Reversingtheorderofobj.wait()andobj.notify()maycausethismethodtocompletenormally.
F.Acalltonotify()ornotifyAll()fromanotherthreadmaycausethismethodtocompletenormally.
第3题:
A.ThiscodeisNOTthread-safe.
B.TheprogrammercanreplaceStringBufferwithStringBuilderwithnootherchanges.
C.ThiscodewillperformwellandconvertingthecodetouseStringBuilderwillnotenhancetheperformance.
D.Thiscodewillperformpoorly.Forbetterperformance,thecodeshouldberewritten:return“<“+this.name+“>”;
第4题:
A.ThetimetofindthevaluefromHashMapwithaPersonkeydependsonthesizeofthemap.
B.DeletingaPersonkeyfromaHashMapwilldeleteallmapentriesforallkeysoftypePerson.
C.InsertingasecondPersonobjectintoaHashSetwillcausethefirstPersonobjecttoberemovedasaduplicate.
D.ThetimetodeterminewhetheraPersonobjectiscontainedinaHashSetisconstantanddoesNOTdependonthesizeofthemap.
第5题:
A.Aisanuplinkport,Bisafabricport,Cisaserverport,Disabackplaneport,EisaDCEinterface,andFisavNIC
B.Aisanuplinkport,Bisaserverport,Cisafabricport,Disabackplaneport,EisaDCEinterface,andFisavNIC
C.Aisanuplinkport,Bisafabricport,Cisabackplaneport,Disaserverport,EisaDCEinterface,andFisavNIC
D.Aisanuplinkport,Bisaserverport,Cisafabricport,DisaDCEinterface,Eisabackplaneport,andFisavNIC
E.Aisanfabricport,Bisadownlinkport,Cisanuplinkport,Disaserverport,EisaVICinterface,andFisavNIC
第6题:
A.Compilationwillsucceedifaextendsb.
B.Compilationwillsucceedifbextendsa.
C.Compilationwillalwaysfailbecauseofanerrorinline7.
D.Compilationwillalwaysfailbecauseofanerrorinline8.
第7题:
A.Compilationfails.
B.Anexceptionisthrownatruntime.
C.Synchronizingtherun()methodwouldmaketheclassthread-safe.
D.Thedatainvariable“x”areprotectedfromconcurrentaccessproblems.
E.DeclaringthedoThings()methodasstaticwouldmaketheclassthread-safe.
F.WrappingthestatementswithindoThings()inasynchronized(newObject()){}blockwouldmaketheclassthread-safe.
第8题:
23.intz=5;24.25.publicvoidstuff1(intx){26.assert(x>0);27.switch(x){28.case2:x=3;29.default:assertfalse;}}30.31.privatevoidstuff2(inty){assert(y<0);}32.33.privatevoidstuff3(){assert(stuff4O);}34.35.privatebooleanstuff4(){z=6;returnfalse;}Whichistrue?()
A.Alloftheassertstatementsareusedappropriately.
B.Onlytheassertstatementonline31isusedappropriately.
C.Theassertstatementsonlines29and31areusedappropriately.
D.Theassertstatementsonlines26and29areusedappropriately.
E.Theassertstatementsonlines29and33areusedappropriately.
F.Theassertstatementsonlines29,31,and33areusedappropriately.
G.Theassertstatementsonlines26,29,and31areusedappropriately.
第9题:
publicclassCreditCard{privateStringcardlD;privateIntegerlimit;publicStringownerName;publicvoidsetCardlnformation(StringcardlD,StringownerName,28.Integerlimit){this.cardlD=cardlD;this.ownerName=ownerName;this.limit=limit;}}Whichistrue?()
A.Theclassisfullyencapsulated.
B.Thecodedemonstratespolymorphism.
C.TheownerNamevariablebreaksencapsulation.
D.ThecardlDandlimitvariablesbreakpolymorphism.
E.ThesetCardlnformationmethodbreaksencapsulation.
第10题:
Line 57 will print the value 2.
Line 57 will print the value 3.
Compilation will fail because of an error in line 55.
Compilation will fail because of an error in line 56.