1. 线程的创建 1.1 使用Thread类创建线程 在Java中,Thread类是创建线程的基础。通过继承Thread类并重写run方法,可以定义线程的执行逻辑。例如: class MyThread extends Thread { public void run() { System