Page 1 of 1

enthuware.ocpjp.v11.2.1235

Posted: Thu Apr 21, 2022 8:08 am
by Pugalendi
I really do not understand the answer.
Q 5 of 19 (Concurrency)- enthuware.ocpjp.v11.2.1235
You want to execute a task that returns a result without blocking. Which of the following types from java.util.concurrent package will be required to achieve this?
Valid answers: ExecutorService, Executors, Callable, Future.

How Runnable is a bad answer?
Is Future get() doesn't block?

Re: enthuware.ocpjp.v11.2.1235

Posted: Thu Apr 21, 2022 8:28 pm
by admin
1. Runnable is not in java.util.concurrent package
2. Its run method returns void.

3. Callable's call method returns immediately.