Java SE 13: Try-with-resources & Custom Exceptions
Java SE 13
| Intermediate
- 12 Videos | 1h 27m 21s
- Includes Assessment
- Earns a Badge
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 coursecorrectly use the throws clause while defining method signaturesimplement exception handling in a chain of methods that sequentially call each otherensure that resources are automatically closed, relying on language support, using the try-with-resources constructrecognize the precise semantics of the try-with-resources construct in Javathrow 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 exceptionscorrectly invoke a method that throws an exception of a checked exception typecorrectly declare or handle exceptions in a chain of functions, each of which throws different types of exceptionscreate a custom exception object by extending the base class Exception, and throw an instance of this exception from your codeinstantiate and throw custom exception objects of both checked and unchecked exception typessummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview2m 8sUP NEXT
-
2.Declaring Exceptions8m 31s
-
3.Exception Handling in Related Methods6m 53s
-
4.Try-with-resources11m 36s
-
5.Semantics of try-with-resources9m 10s
-
6.Throwing Exceptions8m 22s
-
7.Throwing Runtime vs. Checked Exceptions6m 20s
-
8.Invoking a Method That Throws a Checked Exception5m 35s
-
9.The Catch-or-Specify Rule with a Sequence of Methods10m 23s
-
10.Custom Exception Objects7m 59s
-
11.Throwing and Catching Custom Exception Objects9m 4s
-
12.Course Summary1m 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.