1: static void Main(string[] args)
2: {3: try
4: {5: Console.WriteLine("line1");
6: return;
7: }8: finally
9: {10: Console.WriteLine("line2");
11: } 12: }output:
1: line1 2: line2Well in fact, believe it or not, the finally block will always occur no matter what happened in the try block or any optional catch block.
reference: http://chaoticjava.com/posts/finally-finally-block/

No comments:
Post a Comment