Identify lines of code executed
What lines of the following program gets executed, given that the exception is thrown at
LINE C
.
try
{
// LINE A
// LINE B
// LINE C
// LINE D
}
catch(Exception e)
{
// LINE E
// LINE F
}
// LINE G
A.
|
A, B, C, E, F, G
|
B.
|
A, B, C, D, E, F, G
|
C.
|
A, B, C, D, G
|
D.
|
A, B, C, D, E, F
|
Topic:
Try Catch Block In Java
If you need explanation Read this topic
If you need Answer Take test on this topic
User comments below. All of them might not be correct.
the answer is [A] because till line C it will works fine after that the control go to catch block and E,F are executed and the line G is executed ....
Posted by Ashok Kumar Paritala 2014-03-18 03:46:58
answer is A because the compiler works fineuntill exception and then it go to catch block after exception is raised and then it excetues statements after catch block
Posted by Manikanta Yadav 2014-03-18 05:30:05
Congratulations Ashok Kumar Paritala. You are this dose winner. We will send you the link using which you can claim your recharge.
Posted by Merit Campus 2014-03-19 04:26:22