for (int i =0; i <6; i++) {int finalI = i;Future<Integer> future =threadPoolExecutor.submit(newCallable<Integer>() { @OverridepublicIntegercall() throwsException {int sum =0;for (int j =0; j < finalI *10; j++) { sum += j;if (j ==39) { sum = j /0; } }return sum; } });try {Integer integer =null; integer =future.get();System.out.println("任务执行结果:"+ integer); } catch (InterruptedException e) {e.printStackTrace(); } catch (ExecutionException e) {e.printStackTrace(); }}// 输出如下:// 任务执行结果:0// 任务执行结果:45// 任务执行结果:190// 任务执行结果:435// java.util.concurrent.ExecutionException: java.lang.ArithmeticException: / by zero// at java.util.concurrent.FutureTask.report(FutureTask.java:122)// at java.util.concurrent.FutureTask.get(FutureTask.java:192)// at com.xiong.concurrent.threadpoll.Demo_06_01_1_ThreadPoll.main(Demo_06_01_1_ThreadPoll.java:54)// Caused by: java.lang.ArithmeticException: / by zero// at com.xiong.concurrent.threadpoll.Demo_06_01_1_ThreadPoll$3.call(Demo_06_01_1_ThreadPoll.java:46)// at com.xiong.concurrent.threadpoll.Demo_06_01_1_ThreadPoll$3.call(Demo_06_01_1_ThreadPoll.java:39)// at java.util.concurrent.FutureTask.run(FutureTask.java:266)// at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)// at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)// at java.lang.Thread.run(Thread.java:748)// java.util.concurrent.ExecutionException: java.lang.ArithmeticException: / by zero// at java.util.concurrent.FutureTask.report(FutureTask.java:122)// at java.util.concurrent.FutureTask.get(FutureTask.java:192)// at com.xiong.concurrent.threadpoll.Demo_06_01_1_ThreadPoll.main(Demo_06_01_1_ThreadPoll.java:54)// Caused by: java.lang.ArithmeticException: / by zero// at com.xiong.concurrent.threadpoll.Demo_06_01_1_ThreadPoll$3.call(Demo_06_01_1_ThreadPoll.java:46)// at com.xiong.concurrent.threadpoll.Demo_06_01_1_ThreadPoll$3.call(Demo_06_01_1_ThreadPoll.java:39)// at java.util.concurrent.FutureTask.run(FutureTask.java:266)// at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)// at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)// at java.lang.Thread.run(Thread.java:748)