Results 1 to 1 of 1
Thread: How to use Finally
-
How to use Finally
Java Code:class FourException extends Exception { } public class AlwaysFinally { public static void main(String[] args) { System.out.println("Entering first try block"); try { System.out.println("Entering second try block"); try { throw new FourException(); } finally { System.out.println("finally in 2nd try block"); } } catch (FourException e) { System.err.println("Caught FourException in 1st try block"); } finally { System.err.println("finally in 1st try block"); } } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Try---finally
By javarishi in forum New To JavaReplies: 14Last Post: 04-09-2008, 10:34 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks