What is the difference between Java Callable interface and Runnable interface?
What is the difference between Java Callable interface and Runnable interface?
Answer
The Callable interface and Runnable interface both are used by the classes which wanted to execute with multiple threads. However, there are two main differences between the both :
A Callable <V> interface can return a result, whereas the Runnable interface cannot return any result.
A Callable <V> interface can throw a checked exception, whereas the Runnable interface cannot throw checked exception.
A Callable <V> interface cannot be used before the Java 5 whereas the Runnable interface can be used.
Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website.
If you are using this website then its your own responsibility to understand the content of the website