创建多线程的几种方式 继承 Thread #继承Thread 重写run 方法 然后 调用start(); public class windowTest1 { public static void main(String[] args) { //创建 Thread t1 = new Thread(){ @Override public void run() { } }; //使用 t1.start(); } } 实现 Runnable //创建 class Window3 implements Runnable { @Override public void run() { } } //使用 public class windowTest1 { public static void main(String[] args) { Window3 w3 = new Window3(); Thread t2 = new Thread(w3); t2.start(); } } 实现 Callable 接口 //创建 class Window implements Callable{ @Override public Object call() throws Exception { return null; } } //使用 public class Test{ public static void main (String[] args){ Window w = new Window(); FutureTask f = new FutureTask(w); new Thread(f).start(); } }