Page 1 of 1

About Question enthuware.ocpjp.v8.2.1241 :

Posted: Mon Oct 12, 2015 8:22 am
by Martyjee
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

Re: About Question enthuware.ocpjp.v8.2.1241 :

Posted: Mon Oct 12, 2015 9:55 pm
by admin
You are right. Fixed.
thank you for your feedback!

Re: About Question enthuware.ocpjp.v8.2.1241 :

Posted: Tue Dec 01, 2015 1:05 pm
by mrmuiz
Why is option 3
Create a RecursiveAction that subdivides the task and submit all such tasks to a ForkJoinPool.
not correct?
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?

Re: About Question enthuware.ocpjp.v8.2.1241 :

Posted: Tue Dec 01, 2015 8:42 pm
by admin
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.

Re: About Question enthuware.ocpjp.v8.2.1241 :

Posted: Wed Dec 02, 2015 4:08 am
by mrmuiz
I've read the explanation, my confusion comes from the fact that the solution actually submits the task to the pool via fork() method.

Re: About Question enthuware.ocpjp.v8.2.1241 :

Posted: Wed Dec 02, 2015 4:25 am
by admin
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.