Use of Callable and Futures in Java 8 | Java Concurrency.

Опубликовано: 29 Сентябрь 2024
на канале: Vinay Coding Tutorial
27
4

This video is about Callable, Future and executor threads. There are two ways of creating threads - one by extending the Thread class and other by creating a Thread with a Runnable. FIR implementing Runnable, the run() method needs to be implemented which returns a result on completion. A Thread cannot be created with a Callable, it can only be created with a Runnable.
Another difference is that the call() method can throw an exception whereas run() cannot.
#javatutorial #java8 #java8stream