Given the following incorrect program:
Which two changes make the program work correctly?
A.
Results must be retrieved from the newly created MyTask instances and combined.
B.
The threshold value must be increased so that the overhead of task creation does not dominate the cost of computation.
C.
The midpoint computation must be altered so that it splits the workload in an optimal manner.
D.
The compute () method must be changed to return an Integer result.
E.
The compute () method must be enhanced to (fork) newly created tasks.
F.
The myTask class must be modified to extend RecursiveAction instead of RecursiveTask
Explanation:
Incorrect answer:
F: ARecursiveActionis arecursive resultless ForkJoinTask.Here we need a result, so we should use aRecursiveTask.
AD….
The compute () method must be changed to return an Integer result.
So the answer should be
A D
A F
A & D is the correct answers
A D
A D
ad