From the course: Java Exception Handling

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Runtime exception: Unknown runtime exception

Runtime exception: Unknown runtime exception - Java Tutorial

From the course: Java Exception Handling

Runtime exception: Unknown runtime exception

- [Instructor] So far, we know that runtime exceptions are unchecked exceptions, that we are not forced to handle by the compiler. Some example of these exceptions include the number format exception, arithmetic exception, and the no pointer exception. In this video, we will discuss how to handle other exceptions and other runtime exceptions that we may not know could occur or be able to anticipate. When an app is running in the wild or in production, we will likely know from experience to anticipate validating a user's input. We might want to check that they are providing an actual number and not a character to avoid the Null format exception, or check that a divisor is not zero to not cause an arithmetic exception. We can also do Null checks for any objects that could potentially trigger an NPE. However, there exists runtime exceptions that could occur that we will not be able to anticipate. When those exceptions pop up,…

Contents