摘要: public class Demo03 { public static void main(String[] args) throws InterruptedException { Test01(); new Thread(){ public void run(){ for(int i = 0;i< 阅读全文
posted @ 2020-07-20 21:45 一块 阅读(137) 评论(0) 推荐(0) 编辑
摘要: public class Demo02 { public static void main(String[] args) { Test01(); new Thread(){ public void run(){ System.out.println(getName()+".......ccccccc 阅读全文
posted @ 2020-07-20 21:30 一块 阅读(1116) 评论(0) 推荐(0) 编辑
摘要: public class Demo02 { public static void main(String[] args) {第一种方法: new Thread("构造方法设置线程名字"){ public void run(){ System.out.println(this.getName()+". 阅读全文
posted @ 2020-07-20 21:03 一块 阅读(730) 评论(0) 推荐(0) 编辑
摘要: public class Demo01 { public static void main(String[] args) {//方法一: new Thread() { //1.继承Thread类 public void run() { //2.重写run方法 for (int i = 0; i < 阅读全文
posted @ 2020-07-20 20:47 一块 阅读(199) 评论(0) 推荐(0) 编辑