两句三年得,一吟双泪流。—贾岛《题诗后》
| 方法 | 备注 |
|---|---|
| 继承Thread方法 | 线程启动都是Thread().start() |
| 实现Runnable接口 | 依然要使用Thread().start() |
| 实现Callable接口 | JDK1.5 有返回值(RunnableFuture) |
| 线程池Executor | 普通线程池:public interface ExecutorService extends Executor 调度线程池:public interface ScheduledExecutorService extends ExecutorService |

本文探讨了多种线程启动方式及其特点,包括通过继承Thread类、实现Runnable接口及Callable接口的方法,并介绍了线程池的概念及其分类。

被折叠的 条评论
为什么被折叠?



