摘要: 1 package ticket; 2 3 public class Person implements Runnable { 4 private int count =10; 5 private int num = 0; 6 7 @Override 8 public void run() { 9 // TODO Aut... 阅读全文
posted @ 2019-08-05 21:04 弥屹 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 1 package run; 2 3 public class RunThread implements Runnable { 4 private int count; 5 6 @Override 7 public void run() { 8 // TODO Auto-generated method stub 9 ... 阅读全文
posted @ 2019-08-05 21:02 弥屹 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 1 package hospital; 2 3 public class VipThread implements Runnable{ 4 5 @Override 6 public void run() { 7 // TODO Auto-generated method stub 8 for(int i=0;i<10;i+... 阅读全文
posted @ 2019-08-05 17:46 弥屹 阅读(613) 评论(0) 推荐(0) 编辑
摘要: 1 package mountain; 2 /** 3 * 属性:爬100米时长(time) 多少个100米(num); 4 * 线程休眠模拟爬山延时 5 * @author L 6 * 7 */ 8 public class ClimbThread implements Runnable{ 9 10 private int time; ... 阅读全文
posted @ 2019-08-05 17:18 弥屹 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 1 package hello2; 2 /** 3 * 每个线程均输出20次消息数字、“你好”、线程名 4 * @author L 5 * 6 */ 7 public class MyThread implements Runnable { 8 9 @Override 10 public void run() { 11 // TO... 阅读全文
posted @ 2019-08-05 16:53 弥屹 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 1 package hello; 2 /** 3 * 创建两个子线程,每个线程均输出20次消息数字、“你好”、线程名 4 * @author L 5 * 6 */ 7 public class MyThread extends Thread{ 8 9 public void run() { 10 for(int i=0;i<20;i++... 阅读全文
posted @ 2019-08-05 16:44 弥屹 阅读(1064) 评论(0) 推荐(0) 编辑