Java Thread getDefaultUncaughtExceptionHandler() 方法

2025年3月22日 | 阅读1分钟

thread 类的 getDefaultUncaughtExceptionHandler() 方法返回当线程由于未捕获的异常而突然终止时调用的默认处理器。如果返回值是 null,则没有默认处理器。

语法

返回

此方法返回默认处理器。

示例

 

输出

null
Currently running thread is: Thread-0
Currently running thread is: Thread-1
 
下一个主题Java 中的多线程