What is the primary difference between Runnable and Callable interfaces?

  • Callable can be scheduled for future execution.
  • Callable can run without being wrapped in a thread.
  • Runnable allows returning a result.
  • Runnable can be used for multi-threading.
The primary difference between Runnable and Callable interfaces is that Callable allows you to return a result from the computation, whereas Runnable does not. Callable is typically used when you need a result from a task that can be scheduled for future execution, while Runnable is a simple interface for a task that does not return a result.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *