Module [M04] - Exceptions Handling & Text I/O
This module will guide you through learning to use exceptions handlers in your Java programs. Exceptions allow you to interupt anywhere in your program the regular flow of execution to jump to a part of the code dedicated to managing the particular exception you just raised. As you will see, this allows for a very elegant way to handle potential errors and recover from them gracefully instead of having your program crash.
- Textbook Reading Assignments
-
The following sections of the textbook are assigned for this module.
- Chapter #12 – Exceptions Handling & Text I/O
Module Learning Outcomes
In this module, you will develop further your programming skills as follows;
- Tracing
- Ability to read and trace Java programs leveraging Exceptions Handling & Text I/O.
- Implementing
- Ability to write Java programs leveraging Exceptions Handling & Text I/O.
- Testing
- Ability to develop tests for Java programs leveraging Exceptions Handling & Text I/O.
- Debugging
- Ability to troubleshoot Java programs leveraging Exceptions Handling & Text I/O.
- Designing
- Ability to design Java programs leveraging Exceptions Handling & Text I/O.
- Live Coding - BankAccount class
- File Link: YouTube
- We set the stage for an example that will help us apply the Java exception handling techniques you have read about.
- Live Coding - Handling Errors the old school way
- File Link: YouTube
- Before to introduce exceptions to our little example, we attempt to handle one of the possible errors without using these techniques.
- Live Coding - Handling Errors with Exceptions
- File Link: YouTube
- Enough fooling around, here come the Java Exceptions in all their glory.
- B01 - Calculator with and without Exceptions Handling
- This exercise is #12.1 in the 10th edition of our text.
- B02 - ArrayOutOfBoundsException
- This exercise is #12.3 in the 10th edition of our text.
- B03 - IllegalArgumentException for Loan
- This exercise is #12.4 in the 10th edition of our text.
- B04 - Define your own Exception; IllegalTriangleException
- This exercise is #12.5 in the 10th edition of our text.
- B05 - Re-styling Java Source Files
- This exercise is #12.13 in the 10th edition of our text.