Java exceptions come in two main flavors—runtime and throwable. A runtime exception doesn’t have to be declared, but if it isn’t caught and handled, it causes the application to exit—sometimes ungracefully. A throwable exception, on the other hand, requires code to catch it. The difference between the two lies in the class hierarchy.
- [Narrator] Java exceptions come in two main flavors:…checked and unchecked.…An unchecked exception doesn't have to be declared,…but if it isn't caught and handled…it causes the application to exit, sometimes ungracefully.…The two kinds of exceptions I've used so far…are unchecked exceptions,…array index out of bounds exception…and in a previous video, the null pointer exception.…I don't have to do anything special in my code…in order to be able to deal with these exception classes,…so for example, if I change my code…to introduce an exception on purpose,…I'll be able to compile and run the application,…but when the exception is encountered,…the application exits.…
Now, here's why that works.…I'm going to click into the name of the class,…array index out of bounds exception,…and press Shift F1 to go to the online help.…If that doesn't work for you,…you'll need to remember to configure IntelliJ IDEA…to use the online help, and I describe how to do that…in the first course in this series.…If that doesn't work, just go to a browser…
- Debugging Java code
- Handling exceptions
- Creating custom classes
- Working with inheritance
- Managing data collections
- Using Java packages and libraries
- Preparing a Java application for deployment
Skill Level Intermediate
1. Exception Handling and Debugging
2. Create Custom Classes
3. Work with Inheritance
4. Manage Data Collections
5. Use Java Packages and Libraries
Work with dates and times7m 12s
6. Prepare a Java Application for Deployment
Next steps1m 12s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.