OnJava8-Examples/concurrency/ExceptionThread.java

17 lines
430 B
Java
Raw Normal View History

2015-06-15 17:47:35 -07:00
//: concurrency/ExceptionThread.java
// <20>2015 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());
}
} ///:~