FileDocCategorySizeDatePackage
Finally.javaAPI DocExample460Sat Nov 25 12:55:40 GMT 2000None

Finally

public class Finally extends Object
Test case for "finally", to show its effect with return or exit.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)
Main method, does the work of the testing...


		try {
			throw new Exception();
		} catch (Exception e) {
			System.out.println("Caught Exception");
			return;		// with return, Goodbye appears
			// System.exit(1);	// with exit, Goodbye does not appear
		} finally {
			System.out.println("Goodbye!");
		}