Given the following code for the classes MyException and Test:



What is the result?

A.

A

B.

B

C.

Either A or B

D.

A B

E. A compile time error occurs at line n1

題解

MyException是RuntimeException的一種,因此第13行無論拋出MyException還是RuntimeException,都會在第14行被catch接住,而輸出「B」。