Java SE 13: Correctly Using Try-Catch-Finally Blocks

Java    |    Intermediate
  • 11 videos | 1h 17m 5s
  • Includes Assessment
  • Earns a Badge
Rating 3.9 of 21 users Rating 3.9 of 21 users (21)
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.

WHAT YOU WILL LEARN

  • Discover the key concepts covered in this course
    Identify the situations when divide-by-zero exceptions arise
    Apply the methods of the exception base class to obtain exception information
    Use multiple independent catch blocks with a single try block
    Combine multiple independent catch blocks using the | operator
    Combine multiple related catch blocks using the | operator
  • Employ correct exception-handling techniques for io-intensive operations such as working with files
    Use the finally keyword to ensure correct release of file handles and other system resources
    Recognize the exact semantics and limitations of the finally block
    Correctly place the finally block relative to the catch blocks
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 2m 10s
  • 6m 44s
    Find out how to identify the situations when divide-by-zero exceptions occur. FREE ACCESS
  • Locked
    3.  Exception Information
    10m 12s
    To find out how to apply the methods of the Exception base class to obtain exception information. FREE ACCESS
  • Locked
    4.  One Try with Multiple Catch Blocks
    9m 8s
    In this video, you will use multiple catch blocks with a single try block. FREE ACCESS
  • Locked
    5.  Using the Pipe Character to Combine Multiple Catch Blocks
    8m 12s
    In this video, you will learn how to combine multiple independent catch blocks using the "|" operator. FREE ACCESS
  • Locked
    6.  Related Catch Blocks
    8m 36s
    To combine multiple related catch blocks, use the | operator. FREE ACCESS
  • Locked
    7.  Exception Handling for IO Operations
    8m 44s
    In this video, learn how to use correct exception-handling techniques for IO-intensive operations such as working with files. FREE ACCESS
  • Locked
    8.  Using the finally Keyword
    7m 51s
    In this video, you will learn how to use the finally keyword to ensure the correct release of file handles and other system resources. FREE ACCESS
  • Locked
    9.  Semantics and Limitations of finally
    8m 44s
    After completing this video, you will be able to recognize the semantics and limitations of the finally block. FREE ACCESS
  • Locked
    10.  Correct Positioning of finally
    5m 31s
    In this video, find out how to correctly place the finally block in relation to the catch blocks. FREE ACCESS
  • Locked
    11.  Course Summary
    1m 13s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE

Rating 4.3 of 47 users Rating 4.3 of 47 users (47)
Rating 4.7 of 28 users Rating 4.7 of 28 users (28)
Rating 4.3 of 18 users Rating 4.3 of 18 users (18)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.4 of 33 users Rating 4.4 of 33 users (33)
Rating 4.2 of 25 users Rating 4.2 of 25 users (25)
Rating 4.6 of 21 users Rating 4.6 of 21 users (21)