课程: Java Exception Handling

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Runtime exception: Unknown runtime exception

Runtime exception: Unknown runtime exception - Java教程

课程: 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,…

内容