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) {
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" );
You can’t perform that action at this time.
0 commit comments