Example & Tutorial understanding programming in easy ways.

How to get return value of a callable thread in java Executor Framework?

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();


Read More →