CSE 8B Chapter Notes - Chapter 12.1-12.4: Stack Trace

83 views2 pages

Document Summary

Chapter 12 exception handling and text i/o. 12. 1 introduction: exceptions: object representing a runtime error, prevents code from running, and upon not being handled, the code ends abruptly, handling exceptions enables code to continue running even if there has been a runtime error. 12. 2 exception-handling overview: exceptions are thrown from inside a method, method caller catches and handles exception, exceptions enable you to ensure that caller decides whether or not to terminate program try { // what to do when an exception is thrown. If you plan to use try-catch blocks, then the method used in the try-catch blocks must throw new. 12. 4 more on exception handling: exception handler: pushes exception backwards through method calls, starting from current method, exception-handling has 3 steps: declaring, throwing, and catching an exception. 12. 4. 1 declaring exceptions public void mymethod() throws ioexception throw indicates that mymethod may throw ioexception due to what is in its body.

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