imsavva.com

Folder icon

Tags / exceptions

1Z0-808
2018
ATG
Apache Fop
Bash
CNC
Elasticsearch
GWT
Groovy
JPA
Java
JavaScript
Jenkins
Jetty
Kibana
Linux
Malta
MySQL
OCA
PDF
Sed
Ubuntu
Windows services
collections
concurrency
dates
dig deeper
essay
exceptions
food
games
interview questions
logging
movies
patterns
photos
shopping
task
technical
thoughts
trash
trip
windows

UnhandledExceptionHandler in Java: how to catch uncaught exceptions

In this short tutorial, I'm going to describe how to handle uncaught exceptions in threads. This can be done by: Using threadInstance.setUncaughtExceptionHandler() ─ for a specific thread Overriding ThreadGroup's uncaughtException() method ─ for a thread group Using Thread.setDefaultUncaughtExceptionHandler() ─ for all…
Posted on
2017-07-05

Java exceptions handling order

showPostImage(-1069492847)

Uncaught exception: the image was stolen by a UFO

Consider there is a method which can throw IOException and FileNotFoundException. Is there a difference in which order we catch these exceptions in a single try-catch block? Will this code work correctly? The answer is NO. If you handle IOException first, you will never reach FileNotFoundException handling block…
Posted on
2016-03-19
Do I really need the footer?