How to Restart Thread Using UncaughtExceptionHandler | UncaughtExceptionHandler Example
As we are already aware that there are two kinds of exceptions in Java. Checked exceptions and Unchecked exceptions. Checked exceptions must be specified in the throws clause of a method or caught inside them. Unchecked exceptions don't have to be specified or caught. When a checked exception is thrown inside the run() method of a Thread object, we have to catch and treat it accordingly, because the run() method doesn't accept a throws clause. But when an unchecked exception is thrown inside the run() method of a Thread object, the default behavior is to write the stack trace in the console (or log it inside error log file) and exit the program.
Read full article from How to Restart Thread Using UncaughtExceptionHandler | UncaughtExceptionHandler Example
No comments:
Post a Comment