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.

What are runtime exceptions?

What are runtime exceptions? - Java Tutorial

From the course: Java Exception Handling

What are runtime exceptions?

- [Instructor] We have covered throwables and exceptions in a broader scope so far in this course. This chapter, we will dive into examples of runtime exceptions. In this video, we revisit what runtime exceptions are. Runtime exceptions are unchecked exceptions. This means our JVM or the Java Virtual Machine does not check for these exceptions at compile time when code is compiled. Apps will likely not be able to automatically recover from an unchecked exception as they are not always anticipated when writing the code. If you recall, unchecked exceptions do not have to be declared in a methods header like checked exceptions. Of all of the different runtime exceptions, NullPointerExceptions or NPEs for short are probably the most popular runtime exceptions. They can occur anytime an action is attempted on an object that is null. If a method forgets to initiate a string variable and attempts to use that variable in some way,…

Contents