Java SE 13: Try-with-resources & Custom Exceptions

Java SE 13
  • 12 Videos | 1h 32m 21s
  • Includes Assessment
  • Earns a Badge
Likes 10 Likes 10
In this course, you will learn about the correct use of the throws clause, Java's relatively new try-with-resources construct, and the use of custom exceptions. Explore how to correctly use the throws clause while defining method signatures and implementing exception handling in a chain of methods that sequentially call each other. You will learn to ensure that resources are automatically closed, relying on language support, using the try-with-resources construct; and recognize the precise semantics of this construct in Java. This leads to throwing an object of a built-in exception type to respond to an unexpected situation in a program, and differentiating between the semantics of throwing runtime exceptions versus checked exceptions. The correct way to invoke a method that throws an exception of a checked exception type will be examined, along with how to correctly declare or handle exceptions in a chain of functions, each of which throws different types of exceptions. Finally, participants will explore the use of custom exceptions, defining their own exception classes, and then throwing exceptions that belong to those classes.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    correctly use the throws clause while defining method signatures
    implement exception handling in a chain of methods that sequentially call each other
    ensure that resources are automatically closed, relying on language support, using the try-with-resources construct
    recognize the precise semantics of the try-with-resources construct in Java
    throw an object of a built-in exception type in order to respond to an unexpected situation in a program
  • differentiate between the semantics of throwing runtime exceptions vs. throwing checked exceptions
    correctly invoke a method that throws an exception of a checked exception type
    correctly declare or handle exceptions in a chain of functions, each of which throws different types of exceptions
    create a custom exception object by extending the base class Exception, and throw an instance of this exception from your code
    instantiate and throw custom exception objects of both checked and unchecked exception types
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 8s
    UP NEXT
  • Playable
    2. 
    Declaring Exceptions
    8m 31s
  • Locked
    3. 
    Exception Handling in Related Methods
    6m 53s
  • Locked
    4. 
    Try-with-resources
    11m 36s
  • Locked
    5. 
    Semantics of try-with-resources
    9m 10s
  • Locked
    6. 
    Throwing Exceptions
    8m 22s
  • Locked
    7. 
    Throwing Runtime vs. Checked Exceptions
    6m 20s
  • Locked
    8. 
    Invoking a Method That Throws a Checked Exception
    5m 35s
  • Locked
    9. 
    The Catch-or-Specify Rule with a Sequence of Methods
    10m 23s
  • Locked
    10. 
    Custom Exception Objects
    7m 59s
  • Locked
    11. 
    Throwing and Catching Custom Exception Objects
    9m 4s
  • Locked
    12. 
    Course Summary
    1m 20s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

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

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE