.Open CS320/17 Exception and Event Handling and Chapter 14 .Table .Row Prev 16 Concurrency and Java Chapter 13 not sect'n 9 lab16 Java102 .Row 17 Exceptions Chapter 14 lab17 Java103 .Row Next 18 Prolog Chapter 2 sect'n 13 + Prolog Handout lab18 Prolog101 .Close.Table . Preparation Study chapter 14 and these notes. Focus on C++ and Java exceptions. Answer review questions at the end of the handout Hand in answers to 2 or more review questions. Key ideas to remember: .List exception handling an exception exception handler raising an exception disabling an exception built in exception event event handler .Close.List Don't memorize all the exceptions and event types in Java. These details are needed to develop code, not on the final. Instead book-mark(put in favorites) the online WWW documentation .See http://java.sun.com/j2se/1.4.2/docs/api/index.html that Sun maintains. The CSci202 book "Scansholm" and Bjarne Stroustroup's LRM make a useful reference for C++ programmers. They won't be on the final. . Exception Handling Principles Convert_exceptions::=`If you can not handle an exception then convert it to a higher level exception`. Name_the_problem_not_the_thrower::=`name exceptions to indicate what is wrong not where it came from`. centralize_error_logging::pattern. Have a single object that is responsible for recording bad things. standard_error_dialog::pattern. Have a standard user interface for reporting and sorting out errors. . Notes on Chapter 14 Event handling arrived late in the computer languages but is now a vital part of programming(Section 14.6.2...). GUIs (14.6.1) are easier than they look! Exceptions are not a late arrival. They are natural way to cope with Murphy's Law: If anything can go wrong, it will. Note. History of C++/Java exceptions. The `throw` and `catch` terminology comes form ..... CLOS LISP. . Exceptions in Java (Missing point in book) The book does not mention a property of RuntimeException in Java. Normally the compiler rejects code that fails to catch a thrown Exception and doesn't declare that it throws it. This is not true of RuntimeExceptions. A welcome relief. You should spend some time in next sessions's lab exploring the Throwable hierarchy .See http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Throwable.html in Sun's documentation. .Close . Class Work .See ./17q.html . Lab Work .See ./lab/17.html . Next .See ./18.html