O'Reilly logo

Beginning Java 8 Fundamentals: Language Syntax, Arrays, Data Types, Objects, and Regular Expressions by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 9

image

Exception Handling

In this chapter, you will learn

  • About error handling in Java using exceptions
  • How to use try-catch blocks to handle exceptions
  • How to use finally blocks to clean up resources
  • The different between checked and unchecked exceptions
  • How to create a new exception type and use it in your code
  • How to use auto-closeable resources using a try-catch-resources block
  • How to access the stack frames of a thread

What Is an Exception?

An exception is a condition that may arise during the execution of a Java program when a normal path of execution is not defined. For example, a Java program may encounter a numeric expression that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required