Home » Java Thread getDefaultUncaughtExceptionHandler() Method with Examples

Java Thread getDefaultUncaughtExceptionHandler() Method with Examples

by Online Tutorials Library

Java Thread getDefaultUncaughtExceptionHandler() method

The getDefaultUncaughtExceptionHandler() method of thread class returns the default handler invoked when a thread abruptly terminates due to an uncaught exception. If the returned value is null, there is no default.

Syntax

Return

This method returns the default handler.

Example

Output:

null  Currently running thread is: Thread-0  Currently running thread is: Thread-1  

You may also like