摘要: package mianbao; import java.util.Random; public class TestBread { /** * @param args */ public static void main(String[] args) { Store store=new Store(); Maker m=new Make... 阅读全文
posted @ 2017-05-13 20:49 苏轼的红烧肉 阅读(183) 评论(0) 推荐(0) 编辑
摘要: package xiancheng; import java.util.Random; public class TestPiao { /** * @param args */ public static void main(String[] args) { // 创建三个线程 Runnable r=new Ticket(... 阅读全文
posted @ 2017-05-13 19:40 苏轼的红烧肉 阅读(159) 评论(0) 推荐(0) 编辑
摘要: package xiancheng; public class TestRun { public static void main(String[] args) { //1.创建一个线程体 Task task=new Task(); Thread t=new Thread(task); Thread t1=new Thread(... 阅读全文
posted @ 2017-05-13 19:06 苏轼的红烧肉 阅读(139) 评论(0) 推荐(0) 编辑
摘要: package xiancheng; public class TestDemo { /** * @param args */ public static void main(String[] args) { T1 t=new T1(); Daemon d=new Daemon(); t.start(); //将d设置成守护线程 d.setDaemon(t... 阅读全文
posted @ 2017-05-13 16:28 苏轼的红烧肉 阅读(76) 评论(0) 推荐(0) 编辑
摘要: package xiancheng; import java.util.Random; public class XunLei { public static void main(String[] args) throws InterruptedException { System.out.println("开始下载"); MyTask t=new ... 阅读全文
posted @ 2017-05-13 13:59 苏轼的红烧肉 阅读(78) 评论(0) 推荐(0) 编辑