What is Callable Interface in Java



The Callable interface is found in the package java.util.concurrent. The Callable object can return the computed result done by a thread in contrast to a runnable interface which can only run the thread. The Callable object returns a Future object which provides methods to monitor the progress of a task being executed by a thread. The future object can be used to check the status of a Callable and then retrieve the result from the Callable once the thread is done. It also provides timeout functionality.

Updated on: 2019-07-30T22:30:20+05:30

795 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements