Hi, about the review question 9 in Chapter 7: Answer "C. MyTask inherits RecursiveTask." was marked as a correct answer, although it ambiguous, only probably true. So, may be a softer wording such as "may" or "can" "inherit RecursiveTask" would be in order?
MyTask is passed as an argument to ForkJoinPool's invoke() method
The invoke method takes a ForkJoinTask parameter
There are four implementations of ForkJoinTask. AdaptedCallable and AdaptedRunnable are the first two, but they aren't on the exam (remember not to get distracted by extra knowledge). The remaining two are RecursiveAction and RecursiveTask.
RecursiveAction and RecursiveTask each have an abstract compute method that differs in return type. So it has to be RecursiveTask because FindMin returns a value from compute.
Hi, thanks for your reply. My main point was that even though the API documentation of ForkJoinTask says "ForkJoinTask class is not usually directly subclassed," such subclassing is a possible thing to do, and therefore the conclusion that the instance of ForkJoinTask in the question is also an instance of RecursiveAction is "only probably true".
The "Adapted" ones seem to be implementations not even mentioned in API documentation (a web search brought relevant links, though). Then there is CountedCompleter as another documented subclass.
I admit this is probably not a topic where a busy person should put more time/effort. But thanks for your reply.