// Create an executor
ThreadPoolExecutor executor=(ThreadPoolExecutor)Executors.newCachedThreadPool();
// Create a task
Task task=new Task();
System.out.printf("Main: Executing the Task\n");
// Send the task to the executor
Future<String> result=executor.submit(task);