|1||Identify lines of code executed|
|2||Identify lines of code executed469|
|3||Identify lines of code executed470|
|4||Identify lines of code executed471|
|5||Identify lines of code executed472|
|6||Identify lines of code executed473|
|7||Identify lines of code executed474|
|8||Identify lines of code executed475|
|9||Identify lines of code executed476|
|10||Identify lines throwing exceptions|
|11||Creating Try & Catch Block|
If we want to execute all lines of the code in the below program, which lines should throw the exceptions.
Correct Answer : C
To execute all lines of code, we need to throw an exception on the last line of every
Initially, as the program starts with the
LINE A gets executed. Then,
LINE B should throw an exception so that
LINE C gets executed. As
LINE D gets the control, it should turn up with an exception so that
LINE E and
LINE F get executed.
LINE G gets executed in the usual programming sequence.
So, the answer is C.
Topic: Try Catch Block In Java