创建线程 继承Thread类创建线程 public class MyThread extends Thread { @Override public void run() { System.out.println("线程正在运行"); try {