public class ThreadNew { public static void main(String[] args) { //第一种创建方式睿共享 继承Thread new Thread1().start(); //第二种创建方式 实现Runnable new Thread(new Thread2()).s睿共享 tart(); //第三种了解即可 Fu睿共享 tureTaskfutureTask = new FutureTask (new Thread3()); new Thread(futureTask).start(); try { 睿共享 Integer integer = futureTask.get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } } //1.继承Thread类 cla睿共享 ss Thread1 extends Thread{ @Override public void run() { System.out.println("继承"); } } //2.实现Runnable接口 class Thread2 implements Runnable{ @Override public void run() { System.out.println("继承"); } } //3.实现Callable接口 class Thread3 implements Callable{ @Override public Integer call() throws Exception { System.out.println("MyThread3"); return 100; }