摘要: 1.继承Thread类,重写run()方法,调用start开启线程 new TestThread1().start() 2.实现runnable接口,重写run()方法 new Thread(new TestThread3()).start() 不推荐使用继承,因为是单继承,推荐使用实现,因为可以多 阅读全文
posted @ 2022-06-05 23:52 liulangde 阅读(34) 评论(0) 推荐(0)