Skip to content

Commit f3f6632

Browse files
committed
update
1 parent 2cd9ac8 commit f3f6632

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

03concurrency/0301/src/main/java/java0/conc0302/threadpool/ExceptionDemo.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@ public static void main(String[] args) {
1111

1212
try {
1313
Future<Double> future = executorService.submit(() -> {
14-
int a = 1;
15-
return 10.0/(a-1);
14+
throw new RuntimeException("executorService.submit()");
1615
});
1716

1817
double b = future.get();
1918
System.out.println(b);
2019

2120
} catch (Exception ex) {
22-
System.out.println("catch execute");
21+
System.out.println("catch submit");
2322
ex.printStackTrace();
2423
}
2524

2625
try {
2726
executorService.execute(() -> {
28-
int a = 1;
29-
float b = 10/(a-1);
27+
throw new RuntimeException("executorService.execute()");
3028
});
3129
} catch (Exception ex) {
3230
System.out.println("catch execute");

0 commit comments

Comments
 (0)