publicclassa{2.publicvoidm

15 查阅

1.publicclassa{

2.publicvoidmethod1(){

3.try{

4.Bb=newb();

5.b.method2();

6.//morecodehere

7.}catch(TestExceptionte){

8.thrownewRuntimeException(te);

9.}

10.}

11.}

1.publicclassb{

2.publicvoidmethod2()throwsTestException{

3.//morecodehere

4.}

5.}

1.publicclassTestExceptionextendsException{

2.}

Given:

31.publicvoidmethod(){

32.Aa=newa();

33.a.method1();

34.}

WhichistrueifaTestExceptionisthrownonline3ofclassb?()

参考答案:

参考B

计算机考试