Saved Bookmarks
| 1. |
How To Get Return Value Of A Callable Thread In Java Executor Framework? |
|
Answer» 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(); 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(); |
|