This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Is there any exception case to the following statement? In a try-catch-finally construct, if a finally block is present, then it is guaranteed to be executed. -thanks Murthy
MT
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
posted
0
If the program were to terminate prior to that, the finally block would not be exeucted. Take this example:
Also, if an exception is thrown inside the finally block and is not caught within the same scope, the exception will propagate outwards and the finally block will not complete its execution.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Only if you call System.exit before the flow reaches the finally block.