Exceptions
Sometimes, there is a possibility that our code might fail. It might be our fault for making a programming error, or it might be an end user using our system in a way we didn't anticipate. Sometimes, it might even be a hardware failure; a lot of errors can't really be attributed to any one single source, but they are going to happen. The way that our program handles the error case is often just as, if not more, important as how it handles ideal use cases.
In this section, we're going to take a look at Java exceptions. Using Java exceptions, we can detect and catch, and in some cases recover from, errors that occur within our program. As we go through exceptions, there's something really important to keep in mind. Exceptions are ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access