CSC207H1 Lecture : oct15c.docx

33 views1 pages
11 Jan 2013
School
Course
Professor

Document Summary

Generic stacks w/ interface put in oct10c instead. Exceptions: exceptions report exceptional conditions: unusual, strange, disturbing, these conditions deserve exceptional treatment: not the usual go-to-the-next-step, plod-onwards approach, therefore, understanding exceptions requires thinking about a different model of program execution. Exceptionsin java: to throw an exception . Throw throwable: to catch an exception and deal with it: try { statements. } catch (throwable parameter) { // the catch belongs to the try. statements: to say you aren"t going to deal with exceptions (or may throw your own): accessmod returntype methodname (parameters) throws throwable {, analogy: I"m in trouble, so i throw a rock through a window, with a message tied to it. Someone in the following block of code might throw rocks of various kinds. All you catchers line up ready for them. If a rock of my kind comes by, i"ll catch it and deal with it. I"m warning you: if there"s trouble, i may throw a rock.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents