继承Thread类
package java.lang;
public class Thread implements Runnable {}
class Chef extends Thread {
@Override
public void run() {
//做菜
}
}
实现Runnable接口
package java.lang;
public interface Runnable {
void run();
}
相关概念
- 程序
- 进程
- 线程
单核CPU的多线程 vs 多核CPU的多线程
标签:Runnable,JAVA,Thread,CPU,java,多线程,public From: https://www.cnblogs.com/earlyMorning/p/16933918.html