单项选择题

A.Compilationsucceedsand1isprinted.
B.Compilationsucceedsand2isprinted.
C.Anerroratline8causescompilationtofail.
D.Anerroratline13causescompilationtofail.
E.Anerroratline14causescompilationtofail.
相关考题

单项选择题 publicclassXimplementsRunnable(privateintx;privateinty;publicstaticvoidmain(Stringargs)(Xthat=newX();(newThread(that)).start();(newThread(that)).start();)publicsynchronizedvoidrun()(for(;;)(x++;y++;System.out.printIn(x=+x+,y=+y);)))Whatistheresult?()A.Anerroratline11causescompilationtofail.B.Errorsatlines7and8causecompilationtofail.C.Theprogramprintspairsofvaluesforxandythatmightnotalwaysbethesameonthesameline(forexample,“x=2,y=1”)D.Theprogramprintspairsofvaluesforxandythatarealwaysthesameonthesameline(forexample,“x=1,y=1”.Inaddition,eachvalueappearstwice(forexample,“x=1,y=1”followedby“x=1,y=1”)E.Theprogramprintspairsofvaluesforxandythatarealwaysthesameonthesameline(forexample,“x=1,y=1”.Inaddition,eachvalueappearstwice(forexample,“x=1,y=1”followedby“x=2s,y=2”)

单项选择题 classAimplementsrunable(2.int&ensp

单项选择题 classA{publicbytegetNumber(){return1;}}classBextendsA{publicshortgetNumber(){return2;}publicstaticvoidmain(Stringargs){Bb=newB();System.out.printIn(b.getNumber())}}Whatistheresult?()

单项选择题 publicclassTest{publicstaticvoidmain(Stringargs){Stringfoo=args[1];Stringbar=args;Stringbaz=args;System.out.printIn(baz=”+baz);}}Andtheoutput:Baz=2Whichcommandlineinvocationwillproducetheoutput?()

单项选择题 packagefoo;importjava.util.Vector;privateclassMyVectorextendsVector{inti=1;publicMyVector(){i=2;}}publicclassMyNewVectorextendsMyVector{publicMyNewVector(){i=4;}publicstaticvoidmain(Stringargs){MyVectorv=newMyNewVector();}}ThefileMyNewVector.javaisshownintheexhibit.Whatistheresult?()A.Compilationwillsucceed.B.Compilationwillfailatline5.C.Compilationwillfailatline6.D.Compilationwillfailatline14.E.Compilationwillfailatline17.

单项选择题 WhichconstructsaBufferedIputStream?()

单项选择题 classsuper{publicintgetLength(){return4;}}publicclassSubextendsSuper{publiclonggetLength(){return5;}publicstaticvoidmain(Stringargs){supersooper=newSuper();Subsub=newSub();System.out.printIn(sooper.getLength()+,”+sub.getLength()};}Whatistheoutput?()A.4,4B.4,5C.5,4D.5,5E.Thecodewillnotcompile.

单项选择题 ClassOne.javapackagecom.abc.pkg1;publicclassClassOne{privatecharvar=‘a‘;chargetVar(){returnvar;}}ClassTest.javapackagecom.abc.pkg2;importcom.abc.pkg1.ClassOne;publicclassClassTestextendsClassOne{publicstaticvoidmain(Stringargs){chara=newClassOne().getVar();charb=newClassTest().getVar();}}Whatistheresult?()A.Compilationwillfail.B.Compilationsucceedsandnoexceptionsarethrown.C.Compilationsucceedsbutanexceptionisthrownatline5inClassTest.java.D.Compilationsucceedsbutanexceptionisthrownatline6inClassTest.java.

单项选择题 Youwanttolimitaccesstoamethodofapublicclasstomembersofthesameclass.Whichaccessmodifieraccomplishesthisobjective?()

单项选择题 importjava.io.IOException;publicclassExceptionTest(publicstaticvoidmain(Stringargs)try(methodA();)catch(IOExceptione)(system.out.printIn(CaughtIOException”);)catch(Exceptione)(system.out.printIn(CaughtException”);))publicvoidmethodA(){thrownewIOException();}Whatistheresult?()A.Thecodewillnotcompile.B.Theoutputiscaughtexception.C.TheoutputiscaughtIOException.D.Theprogramexecutesnormallywithoutprintingamessage.

单项选择题 abstractclassabstrctIt{abstractfloatgetFloat();}publicclassAbstractTestextendsAbstractIt{privatefloatf1=1.0f;privatefloatgetFloat(){returnf1;}}Whatistheresult?()

单项选择题 intindex=1;intfoo=newint;intbar=foo[index];intbaz=bar+index;Whatistheresult?()

单项选择题 YouareassignedthetaskofbuildingapanelcontainingaTextAreaatthetop,alabeldirectlybelowit,andabuttondirectlybelowthelabel.Ifthethreecomponentsareaddeddirectlytothepanel.WhichlayoutmanagercanthepanelusetoensurethattheTextAreaabsorbsallofthefreeverticalspacewhenthepanelisresized?()A.GridLayout.B.CardLayout.C.FlowLayout.D.BorderLayout.E.GridBagLayout.

单项选择题 publicclassIfTest(publicstaticvoidmain(stringargs){intx=3;inty=1;if(x=y)system.out.printIn(Notequal”);elsesystem.out.printIn(Equal”);})Whatistheresult?()

单项选择题 Youneedtostoreelementsinacollectionthatguaranteesthatnoduplicatesarestoredandallelementscanbeaccessedinnaturalorder.Whichinterfaceprovidesthatcapability?()

单项选择题 Thefilefile.txt”existsonthefilesystemandcontsinsASCIItext.Given:try{Filef=newFile(file.txt”);OutputStreamout=newFileOutputStream(f,true);}catch(IOException){}Whatistheresult?()

判断题 目前华为5G在Sub6G上能达到的最高频谱利用率为98.28%。()

单项选择题 WhichcanbeusedtoencodecharSforoutput?()

单项选择题 Whichgetsthenameoftheparentdirectoryfile“file.txt”?()

多项选择题 5G支持全频谱接入,()频段均可用于5G。