This course covers the bedrock of Exception Handling in Java, the try-catch-finally code structure. Participants will cover the class hierarchies in exception handling; the stream and file processing; and how Java's support for exceptions and streams is built around complex class structures. You will learn how code might result in exceptions that are enclosed within a try block. Because this code structure could result in a signal to Java that normal programming might be disrupted and will cause the code evaluation to be short-circuited, the course explores details of catch blocks, including the use of multiple catch blocks; the use of the pipe operator (operator) to chain different exceptions within the same catch block; and how catch blocks must be arranged for related exceptions. The last part of exception handling is the 'finally block.' This keyword (finally) is used to ensure the correct release of resources, such as file handles, no matter what handled or unhandled exceptions might arise within the try block.
|Objectives |
---|
Java SE 13: Correctly Using Try-Catch-Finally Blocks
|