1.packagefoo;2.3.importjava.util.Vector;4.5.privateclassMyVectorextendsVector{6.inti=1;7.publicMyVector(){8.i=2;9.}10.}11.12.publicclassMyNewVectorextendsMyVector{13.publicMyNewVector(){14.i=4;15.}16.publicstaticvoidmain(Stringargs[]){17.MyVectorv=newMyNewVector();18.}19.}ThefileMyNewVector.javaisshownintheexhibit.Whatistheresult?()

1.packagefoo;

2.

3.importjava.util.Vector;

4.

5.privateclassMyVectorextendsVector{

6.inti=1;

7.publicMyVector(){

8.i=2;

9.}

10.}

11.

12.publicclassMyNewVectorextendsMyVector{

13.publicMyNewVector(){

14.i=4;

15.}

16.publicstaticvoidmain(Stringargs[]){

17.MyVectorv=newMyNewVector();

18.}

19.}

ThefileMyNewVector.javaisshownintheexhibit.Whatistheresult?()


相关考题:

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()”.

1.packagefoo;2.3.importjava.util.Vector;4.5.protectedclassMyVectorVector{6.initi=1;7.publicMyVector(){8.i=2;9.}10.}11.12.publicclassMyNewVectorextendsMyVector{13.publicMyNewVector(){14.i=4;15.}16.publicstaticvoidmain(Stringargs[]){17.MyVectorv=newMyNewVector();18.}19.}Whatistheresult?()A.Compilationsucceeds.B.Compilationfailsbecauseofanerroratline5.C.Compilationfailsbecauseofanerroratline6.D.Compilationfailsbecauseofanerroratline14.E.Compilationfailsbecauseofanerroratline17.

packagefoo;importjava.util.Vector;privateclassMyVectorextendsVector{inti=1;publicMyVector(){i=2;}}publicclassMyNewVectorextendsMyVector{publicMyNewVector(){i=4;}publicstaticvoidmain(Stringargs[]){MyVectorv=newMyNewVector();}}Whatistheresult?()A.Compilationsucceeds.B.Compilationfailsbecauseofanerroratline5.C.Compilationfailsbecauseofanerroratline6.D.Compilationfailsbecauseofanerroratline14.E.Compilationfailsbecauseofanerroratline17.