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.

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.


相关考题:

现有:classClassA{}classClassBextendsClassA{)classClassCextendsClassA{)以及:ClassAp0=newClassA();ClassBpl=newClassB();ClassCp2=newClassC();ClassAp3=newClassB();ClassAp4=newClassC();下列哪些是正确的?() A.p0=pl;B.p1=p2;C.p2=p4;D.p2=(ClassC)pl;E.p1=(ClassB)p3;F.p2=(Classc)p4;

classClassA{}classClassBextendsClassA{}classClassCextendsClassA{}and:ClassAp0=newClassA();ClassBp1=newClassB();ClassCp2=newClassC();ClassAp3=newClassB();ClassAp4=newClassC();Whichthreearevalid?() A.p0=p1;B.p1=p2;C.p2=p4;D.p2=(ClassC)p1;E.p1=(ClassB)p3;F.p2=(ClassC)p4;

Given:classClassA{}classClassBextendsClassA{}classClassCextendsClassA{}and:ClassAp0=newClassA();ClassBp1=newClassB();ClassCp2=newClassC();ClassAp3=newClassB();ClassAp4=newClassC();Whichthreearevalid?()A.p0=p1;B.p1=p2;C.p2=p4;D.p2=(ClassC)p1;E.p1=(ClassB)p3;F.p2=(ClassC)p4;