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
- write a program to catch exception objects with try and catch blocks;
- write a program to raise exceptions via the throw statement;
- describe and use the exception, collection, and I/O features of Java.
Learning Activities
- Read the Learning Notes and follow the links to read the recommended online materials.
- Read the Review Questions and use the discussion board of this course to
- answer any two of the review questions;
- share any useful information about the supplemental reading materials that you have read;
- comment on another student’s response to the review questions;
- answer any questions posed to you.
- 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:
- Poo, D., Kiong, D., & Ashok, S. (2008). Object-Oriented Programming and Java (2nd ed.). London: Springer-Verlag.
- Read Chapter 9: Exception Handling (pp. 119–133).
- Read Section 10.4: File Manipulation (pp. 141–145).
- Read Section 10.8: Tokenizing the Input Using the Scanner Class (pp. 150–151).
- Read Section 10.9: Formatting the Output Using the Format String (p. 151).
- Read Section 10.10: The File Class (p. 152).
- Java™ Platform, Standard Edition 7. (2020). Class StringTokenizer. Redwood Shores, CA: Oracle Corporation.
- Regular expression. (2020, July 29). In Wikipedia. https://en.wikipedia.org/wiki/Regular_expression
- The Java Tutorials. (2020). Lesson: Regular Expressions. Redwood Shores, CA: Oracle Corporation.