Exam 1z1-829 Topic 3 Question 7 Discussion
Actual exam question for Oracle's 1z1-829 exam
Question #: 7
Topic #: 3
Question #: 7
Topic #: 3
Given the code fragment:

Which code fragment invokes all callable objects in the workers set?

Which code fragment invokes all callable objects in the workers set?
Suggested Answer: C Vote an answer
The code fragment in Option C invokes all callable objects in the workers set by using the ExecutorService's invokeAll() method. This method takes a collection of Callable objects and returns a list of Future objects representing the results of the tasks. The other options are incorrect because they either use the wrong method (invokeAny() or submit()) or have syntax errors (missing parentheses or semicolons). Reference: AbstractExecutorService (Java SE 17 & JDK 17) - Oracle
by Dawn at Jan 08, 2024, 08:59 AM
0
0
0
10
Comments
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.
Report Comment
Commenting
You can sign-up / login (it's free).