Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

CallableAndFuture

Pragya Keshap answered on February 22, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


CallableAndFuture

0

In fact, the Future can be made to work with Runnable as well, which is something that will become clear when Executors come into the picture.

public boolean cancel(boolean mayInterrupt): Used to stop the task. It stops the task if it has not started. If it has started, it interrupts the task only if mayInterrupt is true.

public Object get() throws InterruptedException, ExecutionException: Used to get the result of the task. If the task is complete, it returns the result immediately, otherwise it waits till the task is complete and then returns the result.

public boolean isDone(): Returns true if the task is complete and false otherwise 

https://www.geeksforgeeks.org/callable-future-java/

Popularity 1/10 Helpfulness 1/10 Language java
Source: Grepper
Tags: java
Link to this answer
Share Copy Link
Contributed on Feb 22 2023
Pragya Keshap
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.