publicclassOuter{2.publicvoidsomeOuterMethod(){3.//Line34.}5.publicclassInner{}6.publicstaticvoidmain(String[]argv){7.Outero=newOuter();8.//Line89. }10. }WhichinstantiatesaninstanceofInner?() A.newInner();//Atline3B.newInner();//Atline8C.newo.Inner();//Atline8D.newOuter.Inner();//Atline8
publicclassOuter{2.publicvoidsomeOuterMethod(){3.//Line34.}5.publicclassInner{}6.publicstaticvoidmain(String[]argv){7.Outero=newOuter();8.//Line89. }10. }WhichinstantiatesaninstanceofInner?()
A.newInner();//Atline3
B.newInner();//Atline8
C.newo.Inner();//Atline8
D.newOuter.Inner();//Atline8
相关考题:
Whichdeclarationswillallowaclasstobestartedasastandaloneprogram?() A.publicvoidmain(Stringargs[])B.publicvoidstaticmain(Stringargs[])C.publicstaticmain(String[]argv)D.finalpublicstaticvoidmain(String[]array)E.publicstaticvoidmain(Stringargs[])
publicclassFooimplementsRunnable(3.publicvoidrun(Threadt){4.system.out.printIn(Running.”);5.}6.publicstaticvoidmain(String[]args){7.newthread(newFoo()).start();8.)9.)Whatistheresult?() A.Anexceptionisthrown.B.Theprogramexistswithoutprintinganything.C.Anerroratline1causescompilationtofail.D.Anerroratline6causesthecompilationtofail.E.“Running”isprintedandtheprogramexits.
packagefoo;publicclassOuter(publicstaticclassInner())Whichstatementistrue?() A.AninstanceoftheInnerclasscanbeconstructedwith“newOuter.Inner()”B.Aninstanceoftheinnerclasscannotbeconstructedoutsideofpackagefoo.C.Aninstanceoftheinnerclasscanonlybeconstructedfromwithintheouterclass.D.Fromwithinthepackagebar,aninstanceoftheinnerclasscanbeconstructedwith“newinner()”
packagefoo;publicclassOuter{publicstaticclassInner{}}Whichstatementistrue?() A.Compilationfails.B.AninstanceoftheInnerclasscanbeconstructedwith“newOuter.Inner()”.C.AninstanceoftheInnerclasscannotbeconstructedoutsideofpackagefoo.D.AninstanceoftheInnerclasscanbeconstructedonlyfromwithintheOuterclass.E.Fromwithinthepackagefoo,andinstanceoftheInnerclasscanbeconstructedwith“newInner()”.
classTestSuper{22.TestSuper(inti){}3.}4.classTestSubextendsTestSuper{}5.classTestAll{6.publicstaticvoidmain(String[]args){7.newTestSub();8.}9.}Whichistrue?() A.Compilationfails.B.Thecoderunswithoutexception.C.Anexceptionisthrownatline7.D.Anexceptionisthrownatline2.
publicclassDelta{staticbooleanfoo(charc){System.out.print(c);returntrue;}publicstaticvoidmain(String[]argv){inti=0;for(foo(‘A’);foo(‘B’)(i2);foo(‘C’)){i++;foo(‘D’);}}}Whatistheresult?() A.ABDCBDCBB.ABCDABCDC.Compilationfails.D.Anexceptionisthrownatruntime.
分析下列词的结构方式(每个5分,共计50分) 1.秋收 2.白云 3.口红 4.眼热 5.哥哥 6.叮咚 7.雪花 8.月球 9.纸张 10.创业者