11.classA {  12. public void process() { System.out.print(”A “); } }  13. class B extends A {  14. public void process() throws RuntimeException {  15. super.process();  16. if (true) throw new RuntimeException();  17. System.out.print(“B”); }}  18. public static void main(String[] args) {  19. try { ((A)new B()).process(); }  20. catch (Exception e) { System.out.print(”Exception “); }  21. }  What is the result?() A、 ExceptionB、 A ExceptionC、 A Exception BD、 A B ExceptionE、 Compilation fails because of an error in line 14.F、 Compilation fails because of an error in line 19.

11.classA {  12. public void process() { System.out.print(”A “); } }  13. class B extends A {  14. public void process() throws RuntimeException {  15. super.process();  16. if (true) throw new RuntimeException();  17. System.out.print(“B”); }}  18. public static void main(String[] args) {  19. try { ((A)new B()).process(); }  20. catch (Exception e) { System.out.print(”Exception “); }  21. }  What is the result?() 

  • A、 Exception
  • B、 A Exception
  • C、 A Exception B
  • D、 A B Exception
  • E、 Compilation fails because of an error in line 14.
  • F、 Compilation fails because of an error in line 19.

相关考题:

11.classA{12.publicvoidprocess(){System.out.print(”A);}}13.classBextendsA{14.publicvoidprocess()throwsRuntimeException{15.super.process();16.if(true)thrownewRuntimeException();17.System.out.print(B”);}}18.publicstaticvoidmain(String[]args){19.try{((A)newB()).process();}20.catch(Exceptione){System.out.print(”Exception);}21.}Whatistheresult?()A.ExceptionB.AExceptionC.AExceptionBD.ABExceptionE.Compilationfailsbecauseofanerrorinline14.F.Compilationfailsbecauseofanerrorinline19.

11.classa{12.publicvoidprocess(){System.out.print(”a,”);}}13.classbextendsa{14.publicvoidprocess()throwsIOException{15.super.process();16.System.out.print(”b,”);17.thrownewIOException();18.}}19.publicstaticvoidmain(String[]args){20.try{newb().process();}21.catch(IOExceptione){System.out.println(”Exception”);}}Whatistheresult?()A.ExceptionB.a,b,ExceptionC.Compilationfailsbecauseofanerrorinline20.D.Compilationfailsbecauseofanerrorinline14.E.ANullPointerExceptionisthrownatruntime.

interfaceFoo{11.intbar();12.&ensp 10.interfaceFoo{11.intbar();12.}13.14.publicclassBeta{15.16.classAimplementsFoo{17.publicintbar(){return1;}18.}19.20.publicintfubar(Foofoo){returnfoo.bar();}21.22.publicvoidtestFoo(){23.24.classAimplementsFoo{25.publicintbar(){return2;}26.}27.28.System.out.println(fubar(newA()));29.}30.31.publicstaticvoidmain(String[]argv){32.newBeta().testFoo();33.}34.}Whichthreestatementsaretrue?()

单选题11.classA {  12. public void process() { System.out.print(”A “); } }  13. class B extends A {  14. public void process() throws RuntimeException {  15. super.process();  16. if (true) throw new RuntimeException();  17. System.out.print(“B”); }}  18. public static void main(String[] args) {  19. try { ((A)new B()).process(); }  20. catch (Exception e) { System.out.print(”Exception “); }  21. }  What is the result?()A ExceptionB A ExceptionC A Exception BD A B ExceptionE Compilation fails because of an error in line 14.F Compilation fails because of an error in line 19.