Runnable vs Callable

If you are a middle experienced Java Programmer and you are going to attend interview ,there is a high chance that you may face this question in the interview room.If you are in hurry to know this answer, then read only the next paragraph and if you want to understand in details,you can go though the entire page .

Difference Runnable vs Callable ::

Runnable Interface was introduced in jdk 1version, while Callable interface was introduced in jdk 1.5 version.

Runnable is in java.lang package and Callbale is in java.util.concurrent package

run() method involves synchronous computation and call() method involves asynchronous computation.Synchronous means complete the task in same thread ,while asynchronous means a new separate thread is created to achieve the tasks and returns a Future value upon completion of the task.

Now you are done with answering the question to the interviewer.

To understand deep ,let us see sample programs to understand Runnable and Callable in detail.

About the Author

Dear Friends,
I am A.K.M. .This online journal ai1tutorial.com is a humble effort from my side to all students and professionals who want to learn computer science related technologies.I am not a professional blogger and I write posts in this blog only in my leisure time.I may not be 100% perfect in all my posts,but your review comments can surely help me to make it 100% perfect.