There are two answers that are almost the same, namely:
[*]Subclass RecursiveAction and implement the compute() method that computes the new value but does not return anything.
[*]Implement compute() method in RecursiveAction that computes the new value but does not return anything.
The second answer is marked as correct, but I think the first answer is even more accurate, and therefore correct as well. The question asks what would be a good approach and subclassing RecursiveAction is certainly a good approach (together with answer #6)!
Kind regards,
Martijn
About Question enthuware.ocpjp.v8.2.1241 :
Moderators: Site Manager, fjwalraven
-
- Posts: 32
- Joined: Tue Oct 06, 2015 9:06 am
- Contact:
-
- Site Admin
- Posts: 10402
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1241 :
You are right. Fixed.
thank you for your feedback!
thank you for your feedback!
-
- Posts: 49
- Joined: Mon Jul 27, 2015 4:34 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1241 :
Why is option 3
By forking the subtask we're submitting it to the pool. Does the answer intend a new ForkJoinPool (that would make the answer wrong) or am I missing something?
not correct?Create a RecursiveAction that subdivides the task and submit all such tasks to a ForkJoinPool.
By forking the subtask we're submitting it to the pool. Does the answer intend a new ForkJoinPool (that would make the answer wrong) or am I missing something?
-
- Site Admin
- Posts: 10402
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1241 :
As the explanation says, there is no need to "submit" the tasks to the pool while the option says, "and submit all such tasks to a ForkJoinPool".
HTH,
Paul.
HTH,
Paul.
-
- Posts: 49
- Joined: Mon Jul 27, 2015 4:34 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1241 :
I've read the explanation, my confusion comes from the fact that the solution actually submits the task to the pool via fork() method.
-
- Site Admin
- Posts: 10402
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1241 :
OK, I see now what you mean. You are right. The option is not clear. I have updated it to say "...and submit all such tasks to the pool using submit method".
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
Who is online
Users browsing this forum: No registered users and 8 guests