Callable vs Runnable interface in Java
Callable vs Runnable interface in Java
|
|
Runnable 自JDK 1.0就有;Callable JDK 5.0
Runnable 定义任务方法是 public void run();Callable 定义任务方法是 public
call() throws Exception run()无返回值;call返回值;
Callable 泛型接口;
Callable 可抛检查型异常;