Code example for Future

Methods: get, sleep

0
                return "Other less important but longtime things."; 
            } 
        }; 
        Future<String> task = exec.submit(call);
        //重要的事情 
        Thread.sleep(1000 * 3);
        System.out.println("Let's do important things.");
        //不重要的事情 
        String obj = task.get();
        System.out.println(obj);
        //关闭线程池 
        exec.shutdown();
    } 
}