differences between java.util.concurrent.Callable and java.lang.Runnable



Similarity and differences between java.util.concurrent.Callable and  java.lang.Runnable?

Similarity between java.util.concurrent.Callable and  java.lang.Runnable?
Instances of class which implements callable are executed by another thread.


Difference between java.util.concurrent.Callable and  java.lang.Runnable?
Class implementing Callable interface must override call() method. call() method returns computed result or throws an exception if unable to do so.
Class implementing Runnable interface must override run() method.
A Runnable does not return a result and can neither throw a checked exception.



Having any doubt? or you you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.

Related >
Important Similarity and Differences >

Differences between execute() and submit() method of executor framework

Difference between synchronized and ReentrantLock

Similarity and Difference between CyclicBarrier and CountDownLatch in Java


Must read for you :

No comments:

Post a Comment