}
/*
* Create a new Task to sum the elements of the array
*/
MyRecursiveTask task=new MyRecursiveTask(array,0,array.length);
/*
* Send the task to the ForkJoinPool
*/
pool.execute(task);
/*
* Wait for the finalization of the task
*/
task.join();
/*
* Shutdown the pool
*/
pool.shutdown();
/*
* Wait for the finalization of the pool
*/
pool.awaitTermination(1, TimeUnit.DAYS);
/*
* Write the result of the task
*/
System.out.printf("Main: Result: %d\n",task.get());
/*
* Write a message indicating the end of the program
*/
System.out.printf("Main: End of the program\n");