OnJava8-Examples/concurrency/ExceptionThread.java
2015-11-14 16:18:05 -08:00

17 lines
423 B
Java

// concurrency/ExceptionThread.java
// ©2016 MindView LLC: see Copyright.txt
// {ValidateByHand}
// {ThrowsException}
import java.util.concurrent.*;
public class ExceptionThread implements Runnable {
@Override
public void run() {
throw new RuntimeException();
}
public static void main(String[] args) {
ExecutorService exec = Executors.newCachedThreadPool();
exec.execute(new ExceptionThread());
}
}