File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
03concurrency/0301/src/main/java/java0/conc0302/threadpool Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,20 @@ public static void main(String[] args) {
11
11
12
12
try {
13
13
Future <Double > future = executorService .submit (() -> {
14
- int a = 1 ;
15
- return 10.0 /(a -1 );
14
+ throw new RuntimeException ("executorService.submit()" );
16
15
});
17
16
18
17
double b = future .get ();
19
18
System .out .println (b );
20
19
21
20
} catch (Exception ex ) {
22
- System .out .println ("catch execute " );
21
+ System .out .println ("catch submit " );
23
22
ex .printStackTrace ();
24
23
}
25
24
26
25
try {
27
26
executorService .execute (() -> {
28
- int a = 1 ;
29
- float b = 10 /(a -1 );
27
+ throw new RuntimeException ("executorService.execute()" );
30
28
});
31
29
} catch (Exception ex ) {
32
30
System .out .println ("catch execute" );
You can’t perform that action at this time.
0 commit comments