Java Thread setDefaultUncaughtExceptionHandler() methodThe 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. SyntaxParametereh: It is the object which is used as the default uncaught exception handler. ReturnThis method does not return any value. ExceptionSecurityException: This exception throws if a security manager is present and it denies RuntimePermission. ExampleTest it NowOutput: Exception caught: java.lang.RuntimeException Next Topicmultithreading in java |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India