PrepAway - Latest Free Exam Questions & Answers

What is the output of the following code?

What is the output of the following code?
<code>
try{
classMyException extends Exception {};
try{
thrownew MyException;
}
catch(Exception $e) {
echo”1:”;
throw$e;
}catch(MyException $e) {
echo”2:”;
throw$e;
}}
catch(Exception $e) {
echoget_class($e);
}
</code>

PrepAway - Latest Free Exam Questions & Answers

A.
A parser error, try cannot befollowd by multiple catch

B.
1:

C.
2:

D.
1:Exception

E.
1:MyException

F.
2:MyException

G.
MyException

One Comment on “What is the output of the following code?


Leave a Reply

Your email address will not be published. Required fields are marked *