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

Java    |    Intermediate
  • 12 videos | 1h 27m 21s
  • Includes Assessment
  • Earns a Badge
Rating 4.5 of 18 users Rating 4.5 of 18 users (18)
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

  • 2m 8s
  • 8m 31s
    In this video, learn how to correctly use the throws clause when defining method signatures. FREE ACCESS
  • Locked
    3.  Exception Handling in Related Methods
    6m 53s
    Learn how to implement exception handling in a chain of methods that call each other sequentially. FREE ACCESS
  • Locked
    4.  Try-with-resources
    11m 36s
    To ensure that resources are automatically closed, rely on language support and use the try-with-resources construct. FREE ACCESS
  • Locked
    5.  Semantics of try-with-resources
    9m 10s
    After completing this video, you will be able to recognize the precise semantics of the try-with-resources construct in Java. FREE ACCESS
  • Locked
    6.  Throwing Exceptions
    8m 22s
    In this video, find out how to throw an object of a built-in exception type in order to respond to an unexpected situation in a program. FREE ACCESS
  • Locked
    7.  Throwing Runtime vs. Checked Exceptions
    6m 20s
    In this video, you will learn how to differentiate between the semantics of throwing runtime exceptions and throwing checked exceptions. FREE ACCESS
  • Locked
    8.  Invoking a Method That Throws a Checked Exception
    5m 35s
    In this video, learn how to correctly invoke a method that throws an exception of a checked exception type. FREE ACCESS
  • Locked
    9.  The Catch-or-Specify Rule with a Sequence of Methods
    10m 23s
    During this video, you will learn how to correctly declare or handle exceptions in a chain of functions, each of which throws a different type of exception. FREE ACCESS
  • Locked
    10.  Custom Exception Objects
    7m 59s
    During this video, you will learn how to create a custom exception object by extending the base class Exception, and throw an instance of this exception from your code. FREE ACCESS
  • Locked
    11.  Throwing and Catching Custom Exception Objects
    9m 4s
    In this video, you will create and throw custom exception objects of both checked and unchecked exception types. FREE ACCESS
  • 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 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 18 users Rating 4.3 of 18 users (18)
Rating 4.6 of 27 users Rating 4.6 of 27 users (27)
Rating 4.6 of 57 users Rating 4.6 of 57 users (57)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.2 of 25 users Rating 4.2 of 25 users (25)
Rating 4.5 of 18 users Rating 4.5 of 18 users (18)
Rating 4.4 of 33 users Rating 4.4 of 33 users (33)