

class Apr8 {

	public static void main(String[] args) {

		Foo f1 = null;
		Foo f2 = null;

		try {
			f1 = new Foo(1, "hello");
			f2 = new Foo(12, null);
			System.out.println("created instances of Foo");
		}
		catch(InvalidDataException e) {
			System.out.println(e.getMessage());
			f1.printHello();
			//System.exit(0);
		}
		catch(AnotherException e) {
			System.out.println(e.getMessage());
			//System.exit(0);
		}
		catch(Exception e) {
			// will not be run

		}
		finally {
			System.out.println("finally block run");
		}

		System.out.println("all is well");

		
	}

} // end of file
