OnJava8-Examples/concurrency/ExceptionThread.java
2015-11-03 12:00:44 -08:00

16 lines
382 B
Java

// concurrency/ExceptionThread.java
// {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());
}
}