Using Future, we can get the return value of callable thread.ExecutorService exService = Executors.newCachedThreadPool();Future<Integer> future=exService.submit(new CallableThread());int val=future.get();
What do you understand by Executor Framework in Java, what is java executor framework
How to terminate a thread in Executor Framework in java?
What is the role of Executors.unconfigurableExecutorService in Executor Framework?
What is the role of ExecutorService in Java?
What is difference between shutdownNow() and shutdown() in Executor Framework in java?
What is Executors in java Executor Framework?
What is the role of FutureTask and Future in java?
What is the role of Executors.privilegedThreadFactory() in Executor Framework?
What are the different policy in Executor Framework?
How to get return value of a callable thread in java Executor Framework?