What is the function of the Future submit(Runnable task, T result) method of the ExecutorService interface?

What is the function of the Future<?> submit(Runnable task, T result) method of the ExecutorService interface?



Answer: Submits the thread for execution and returns a Future to represent the task. The get() method of the Future returns the result supplied as a parameter.


Learn More :

Multithreading and Concurrent Processing

Learn More Multiple Choice Question :