April 18
Examples from April 18
Today we started with two more examples of exception catching:
TestMultipleExceptions.java and SimpleInput.java Here an exception is generated several levels deep in the runtime stack, and caught in main().
TestFinally.java and SimpleInput.java This shows a finally clause, which is executed even if the try or catch clauses execute return statements.
GoReadYourself.java and SimpleInput.java This shows a program that uses the SimpleInput class to read a text file line by line. The file that is read is actually GoReadYourself.java, so in some ways this program prints itself.