Which two changes make the program work correctly?

Given the following incorrect program:

Which two changes make the program work correctly?

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.



Leave a Reply 7

Your email address will not be published. Required fields are marked *


Ray

Ray

The compute () method must be changed to return an Integer result.

So the answer should be
A D

John

John

A F

John

John

A & D is the correct answers