Tell me the most simple and with examples if you can distinguish between submit and invoke in ForkJoinPool and when they are best used. Shot Google does not help to find these answers.

    1 answer 1

    invoke - the task will be executed and the result of the task will be returned.

    execute and submit return the task to the queue and can be continued in another thread. That is, it does not wait for the completion of the task.

    If you want to see the result of the execution, then call join after execute or submit