-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Learn Java 17 Programming - Second Edition
By :
In Chapter 1, Getting Started with Java 17, we briefly introduced exceptions. In this chapter, we will treat this topic more systematically. There are two kinds of exceptions in Java: checked and unchecked. We’ll demonstrate each of them, and the differences between the two will be explained. Additionally, you will learn about the syntax of the Java constructs related to exception handling and the best practices to address (that is, handle) those exceptions. The chapter will end on the related topic of assertion statements, which can be used to debug the code in production.
In this chapter, we will cover the following topics:
try, catch, and finally blocksthrows statementthrow statementassert statementSo, let’s begin!