摘要:
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... 阅读全文
摘要:
package xiancheng; import java.util.Random; public class TestPiao { /** * @param args */ public static void main(String[] args) { // 创建三个线程 Runnable r=new Ticket(... 阅读全文
摘要:
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(... 阅读全文
摘要:
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... 阅读全文
摘要:
package xiancheng; import java.util.Random; public class XunLei { public static void main(String[] args) throws InterruptedException { System.out.println("开始下载"); MyTask t=new ... 阅读全文