Callable
The functional interface for a task that returns a result and may throw an exception, submitted to an executor.
In more detail
Unlike Runnable, its call method returns a value, which arrives through a Future. The lambda () -> 6 * 7 submitted in the course is a Callable.
Related terms
- Runnable — The functional interface for a task that takes no input and returns no result, used to give a thread work to do.
- Future — An object representing the result of a task that may not have finished yet; get waits for it.
- ExecutorService — The standard-library service that owns a pool of worker threads and runs tasks you submit to it, returning a Future for each.
Taught in
- The ExecutorService — Modern Java: Virtual Threads & High-Throughput Services
- Jars, Automatic Modules And Runtime Images — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Platform And Virtual Threads, Runnable And Callable — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sprint: Modules And Concurrency — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Final Review And Exam Day — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep