文章目录 一、新增方式1:实现Callable接口 (1)介绍 (2)案例 (3)总结对比 二、新增方式2:使用线程池 (1)问题与解决思路 1、现有问题 2、解决思路 3、好处 (2)线程池相关API (3)案例 一、新增方式1:实现Callable接口 (1)介绍 【Callable接口】 @FunctionalInterface 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 */