Java Thread setDefaultUncaughtExceptionHandler() method
The setDefaultUncaughtExceptionHandler() method of thread class sets the default handler invoked when a thread abruptly terminates due to an uncaught exception, and no other handler has been defined for that thread.
eh: It is the object which is used as the default uncaught exception handler.
This method does not return any value.
SecurityException: This exception throws if a security manager is present and it denies RuntimePermission.
ExampleTest it Now
Exception caught: java.lang.RuntimeException