摘要: // 用 API 给线程起名1 public class MyThreadApi extends Thread { 2 @Override 3 public void run(){ 4 for (int i = 0; i < 5; i++) { 5 System.out.println(Thread 阅读全文
posted @ 2024-01-29 20:33 小※兽 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1 // 方式一:继承Thread类 2 public class Thread{ 3 public static void main(String[] args) { 4 Thread t = new MyThread(); 5 t.start(); 6 7 for (int i = 0; i < 阅读全文
posted @ 2024-01-29 19:11 小※兽 阅读(7) 评论(0) 推荐(0) 编辑