answer : C
theoretically it could return : Pong Ping
B. not compiled method execute is void
D. it will not compile
the invokeAny method parameter has to be a type of Collection
<T> T invokeAny(Collection<? extends Callable<T>> tasks)
only C:
D:cannot because invokeany return a Result of callables completely ok.
Future<String> future = executor.invokeAny(List.of(new Callable<String>(){
public String call() throws Exception {
return "PONG";
};
}));
A: call method of callabe return a type String not a future and callabe cannot be asigned to future directry
B: compile error BECAUSE Future<String> future = service.submit(()->"Pong"); is not a runnable
C: Future<String> future = service.submit(()->"Pong"); => ok
D: invoke any acept Collection of callable not a single callable
This section is not available anymore. Please use the main Exam Page.1z0-819 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
4 months, 4 weeks agod7bb0b2
10 months, 2 weeks agod7bb0b2
9 months, 3 weeks agoTheOneAboveAll
1 year agoOmnisumem
1 year ago[Removed]
1 year, 1 month agoJtic
1 year, 8 months ago