单项选择题

A.链接
B.标识
C.编译
D.描述
相关考题

单项选择题 单个网页框架最好不要超过()个。

单项选择题 11.classCup{}12.classPoisonCupextendsCup{}21.publicvoidtakeCup(Cupc){22.if(cinstanceofPoisonCup){23.System.out.println(”Inconceivable!”);24.}elseif(cinstanceofCup){25.System.out.println(”Dizzyingintellect!”);26.}else{27.System.exit(0);28.}29.}Andtheexecutionofthestatements:Cupcup=newPoisonCup();takeCup(cup);Whatistheoutput?()A.Inconceivable!B.Dizzyingintellect!C.Thecoderunswithnooutput.D.Anexceptionisthrownatruntime.E.Compilationfailsbecauseofanerrorinline22.

单项选择题 客户刚刚提交订单,此时订单的状态是()。

单项选择题 classFoo{privateintx;publicFoo(intx){this.x=x;}publicvoidsetX(intx){this.x=x;}publicintgetX(){returnx;}}publicclassGamma{staticFoofooBar(Foofoo){foo=newFoo(100);returnfoo;}publicstaticvoidmain(String[]args){Foofoo=newFoo(300);System.out.print(foo.getX()+-);FoofooFoo=fooBar(foo);System.out.print(foo.getX()+-);System.out.print(fooFoo.getX()+-);foo=fooBar(fooFoo);System.out.print(foo.getX()+-);System.out.prmt(fooFoo.getX());}}Whatistheoutputofthisprogram?()

单项选择题 11.classPayload{12.privateintweight;13.publicPayload(intwt){weight=wt;}13.publicvoidsetWeight(mtw){weight=w;}15.publicStringtoString{returnInteger.toString(weight);}16.}17.18.publicclassTestPayload{19.staticvoidchangePayload(Payloadp){20./*insertcodehere*/21.}22.23.publicstaticvoidmain(String[]args){24.Payloadp=newPayload();25.p.setWeight(1024);26.changePayload(p);27.System.out.println(”Thevalueofpis+p);28.}29.}Whichstatement,placedatline20,causesthecodetoprintThevalueofpis420.”?()

单项选择题 publicstaticvoidtest(Stringstr){intcheck=4;if(check=str.length()){System.out.print(str.charAt(check-=1)+,);}else{System.out.print(str.charAt(0)+,);}}andtheinvocation:test(”four”);test(”tee”);test(”to”);Whatistheresult?()A.r,t,t,B.r,e,o,C.Compilationfails.D.Anexceptionisthrownatruntime.

单项选择题 Giventhefully-qualifiedclassnames:com.foo.bar.Dogcom.foo.bar.blatz.Bookcom.bar.Carcom.bar.blatz.SunWhichgraphrepresentsthecorrectdirectorystructureforaJARfilefromwhichthoseclassescanbeusedbythecompilerandJYM?()A.JarAB.JarBC.JarCD.JarDE.JarE

单项选择题 Aclassgames.cards.PokeriscorrectlydefinedinthejarfilePoker.jar.AuserwantstoexecutethemainmethodofPokeronaUNIXsystemusingthecommand:javagames.cards.PokerWhatallowstheusertodothis?()

单项选择题 publicclassScoreimplementsComparable{privateintwins,losses;publicScore(intw,int1){wins=w;losses=1;}publicintgetWins(){returnwins;}publicintgetLosses(){returnlosses;}publicStringtoString(){return<+wins+,+losses+>”;}//insertcodehere}Whichmethodwillcompletethisclass?()A.publicintcompareTo(Objecto){/*modecodehere*/}B.publicintcompareTo(Scoreother){/*morecodehere*/}C.publicintcompare(Scores1,Scores2){/*morecodehere*/}D.publicintcompare(Objecto1,Objecto2){/*morecodehere*/}

单项选择题 1.publicclassTarget{2.privateinti=0;3.publicintaddOne(){4.return++i;5.}6.}And:1.publicclassClient{2.publicstaticvoidmain(String[]args){3.System.out.println(newTarget().addOne());4.}5.}WhichchangecanyoumaketoTargetwithoutaffectingClient?()A.Line4ofclassTargetcanbechangedtoreturni++;B.Line2ofclassTargetcanbechangedtoprivateinti=1;C.Line3ofclassTargetcanbechangedtoprivateintaddOne(){D.Line2ofclassTargetcanbechangedtoprivateIntegeri=0;

单项选择题 packagetest;classTarget{publicStringname=hello”;}Whatcandirectlyaccessandchangethevalueofthevariablename?()

单项选择题 voidwaitForSignal(){Objectobj=newObject();synchronized(Thread.currentThread()){obj.wait();obj.notify();}}Whichistrue?()

单项选择题 classComputationextendsThread{privateintnum;privatebooleanisComplete;privateintresult;publicComputation(intnum){this.num=num;}publicsynchronizedvoidrun(){result=num*2;isComplete=true;notify();}publicsynchronizedintgetResult(){while(!isComplete){try{wait();}catch(InterruptedExceptione){}}returnresult;}publicstaticvoidmain(String[]args){Computation[]computations=newComputation[4];for(inti=0;i<computations.length;i++){computations[i]=newComputation(i);computations[i].start();}for(Computationc:computations)System.out.print(c.getResult()+);}}Whatistheresult?()

单项选择题 fooandbararepublicreferencesavailabletomanyotherthreads.fooreferstoaThreadandbarisanObject.Thethreadfooiscurrentlyexecutingbar.wait().Fromanotherthread,whichstatementisthemostreliablewaytoensuethatfoowillstopexecutingwait()?A.foo.notify();B.bar.notify();C.foo.notifyAll();D.Thread.notify();E.bar.notiFYAll();F.Object.notify();

单项选择题 Stringtest=TestA.TestB.TestC.”;12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpressioninsertedatline12willcorrectlysplittestintoTestA,”TestB,”andTestC”?()

单项选择题 System.out.format(”Piisapproximately%d.”,Math.PI);Whatistheresult?()

单项选择题 Stringtest=a1b2c3”;12.String[]tokens=test.split(”\d”);13.for(Strings:tokens)System.out.print(s+);Whatistheresult?()

单项选择题 Stringtest=Thisisatest”;12.String[]tokens=test.split(”s”);13.System.out.println(tokens.length);Whatistheresult?()

单项选择题 publicclassStarterextendsThread{privateintx=2;publicstaticvoidmain(String[]args)throwsException{newStarter().makeItSo();}publicStarter(){x=5;start();}publicvoidmakeItSo()throwsException{join();x=x-1;System.out.println(x);}publicvoidrun(){x*=2;}}Whatistheoutputifthemain()methodisrum?()A.4B.5C.8D.9E.Compilationfails.F.Anexceptionisthrownatruntime.G.Itisimpossibletodetermineforcertain.

单项选择题 publicclassTestOne{publicstaticvoidmain(String[]args)throwsException{Thread.sleep(3000);System.out.println(”sleep”);}}Whatistheresult?()