Skip to main content
ICT
Lesson A13 - Exceptions and File I/O
 
Main   Previous Next
 

Summary/Review page 9 of 12

Exceptions provide a clean way to detect and handle unexpected situations. When a program detects an error, it throws an exception. When an exception is thrown, control is transferred to the appropriate exception handler. By defining a method that catches the exception, the programmer can write the code to handle the error. Exceptions are used heavily when dealing with File I/O because there are many situations that can turn dangerous when reading and writing data directly from a hard drive.

Main   Previous Next
Contact
 © ICT 2006, All Rights Reserved.