What is the difference between submit and execute method with ThreadPoolExecutor

java, multithreading

Solution

The difference is that `execute` doesn't return a `Future`, so you can't wait for the completion of the `Runnable` and get any exception it throws using that.

Problem

I found there are two ways (submit and execute) to add a Runnable into a thread pool, what is the difference?

Original source

Related problems