7
在ExecutorService的提交和ExecutorService的执行之间选择
如果返回值与我无关,我应该如何在ExecutorService的 Submit或execute之间进行选择? 如果同时测试两者,则除了返回的值外,我看不到其他任何差异。 ExecutorService threadExecutor = Executors.newSingleThreadExecutor(); threadExecutor.execute(new Task()); ExecutorService threadExecutor = Executors.newSingleThreadExecutor(); threadExecutor.submit(new Task());