1.Callable和Runnable 看Callable接口: public interface Callable<V> { /** * Computes a result, or throws an exception if unable to do so. * * @return computed result * @throws Exception if unable to compute a result */ V call() throws Exception; } 看Runnab
系列目录: 揭开Future的神秘面纱——任务取消 揭开Future的神秘面纱——任务执行 揭开Future的神秘面纱——结果获取 使用案例 在之前写过的一篇随笔中已经提到了Future的应用场景和特性.(ExecutorService——<T> Future<T> submit(Callable<T> task)) 我们先来回顾一下: public class FutureCancelDemo { public static void main(String[] ar