| 123456789101112131415161718192021 |
- package course;
- /**
- * @author WanJl
- * @version 1.0
- * @title ThreadTest
- * @description
- * @create 2026/8/8
- */
- public class ThreadTest01 {
- public static void main(String[] args) {
- //创建自定义线程类的对象
- MyThread mt1=new MyThread("线程1");
- MyThread mt2=new MyThread("线程2");
- //调用自定义线程类的start()方法 启动线程。
- mt1.start();
- mt2.start();
- }
- }
|