i. http://en.wikipedia.org/wiki/Reversi
ii. http://www.darkfish.com/turncoat/Turncoat.html
iii. Partners - by Friday, 12/9
i. ()
ii. (String message)
i. getMessage()
ii. PrintStackTrace()
i. Catching locally vs on call stack
1. Rule of thumb – checked exceptions must be
caught somewhere in a program. So, a
method that invokes it must either catch it or throw it, etc. If it throws it, any method that calls it
must either catch it or throw it. Etc…
ii. Catch specific Exceptions
iii. Can have multiple
iv. Exception Hierarchy
1. http://www.programcreek.com/wp-content/uploads/2009/02/hierarchy.png
2. In general – runtime exceptions are unchecked,
ioexceptions are checked
v. Should order catch blocks from most specific
to least specific
i. http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html
ii. If the method statement includes throws
<Exception>, then it is checked
i. Avoid try/catch/finally
ii. Nested try/finally and try/catch
i. Try/catch/finally
ii. Be careful to make sure you don’t get ‘might
not be initialized’ compile-time errors
i. It depends
ii. Unchecked might be ‘easier’
iii. But, checked is often correct