OnJava8-Examples/concurrency/SettingDefaultHandler.java
Bruce Eckel 7265b6aceb Updated to match book
Partway through update
2015-04-29 12:53:35 -07:00

14 lines
416 B
Java

//: concurrency/SettingDefaultHandler.java
// {RunByHand}
import java.util.concurrent.*;
public class SettingDefaultHandler {
public static void main(String[] args) {
Thread.setDefaultUncaughtExceptionHandler(
new MyUncaughtExceptionHandler());
ExecutorService exec = Executors.newCachedThreadPool();
exec.execute(new ExceptionThread());
}
} /* Output:
caught java.lang.RuntimeException
*///:~