I have understood the difference between Runnable
and Callable
interface in Java. From Java 1.5 additional features has been added to Runnable
IMHO, Runnable is a better type to use when taking as argument a function which
Don't forget that Callable.call()
throws Exception. That means that if you take a Callable as argument, this Callable can throw any kind of exception, and you must have a way to handle them all in a correct way. If you can't do that, it's better to let the implementor of the Callable handle the exception as he wants to, and make the argument a Runnable to make that clear.