Skip To Content

Athabasca University

Unit 4: Exceptions, Collections, and I/O

Unit Overview

This unit discusses the exception handling mechanism in Java and demonstrates how to accomplish advanced control-flow using try/catch and throw.

Learning Outcomes

After completing this unit, you should be able to

  1. write a program to catch exception objects with try and catch blocks;
  2. write a program to raise exceptions via the throw statement;
  3. describe and use the exception, collection, and I/O features of Java.

Learning Activities

  1. Read the Learning Notes and follow the links to read the recommended online materials.
  2. Read the Review Questions and use the discussion board of this course to
    1. answer any two of the review questions;
    2. share any useful information about the supplemental reading materials that you have read;
    3. comment on another student’s response to the review questions;
    4. answer any questions posed to you.
  3. Complete the Unit Exercises and share the experience with your peers on the discussion board. [Note: Do not post assignment-relevant pseudocodes or source codes at any time; however, you can post your thoughts, ideas, and problem-solving steps.]

Learning Notes

Read the following recommended online materials:

  1. Poo, D., Kiong, D., & Ashok, S. (2008). Object-Oriented Programming and Java (2nd ed.). London: Springer-Verlag.
    1. Read Chapter 9: Exception Handling (pp. 119–133).
    2. Read Section 10.4: File Manipulation (pp. 141–145).
    3. Read Section 10.8: Tokenizing the Input Using the Scanner Class (pp. 150–151).
    4. Read Section 10.9: Formatting the Output Using the Format String (p. 151).
    5. Read Section 10.10: The File Class (p. 152).
  2. Java™ Platform, Standard Edition 7. (2020). Class StringTokenizer. Redwood Shores, CA: Oracle Corporation.
  3. Regular expression. (2020, July 29). In Wikipedia. https://en.wikipedia.org/wiki/Regular_expression
  4. The Java Tutorials. (2020). Lesson: Regular Expressions. Redwood Shores, CA: Oracle Corporation.

Updated December 17 2021 by FST Course Production Staff