摘要:
public class Demo07 { public static void main(String[] args) { final Printer p = new Printer(); new Thread() { public void run() { while (true) { p.pr 阅读全文
摘要:
public class Demo06 { public static void main(String[] args) { Thread t1 = new Thread() { public void run() { for (int i = 0; i < 10; i++) { System.ou 阅读全文
摘要:
join(); 当前线程暂停,等待指定的线程执行结束后,当前线程在继续。 join(int); 可以等待指定的毫秒之后继续。 public class Demo05 { public static void main(String[] args) { Thread t1 = new Thread() 阅读全文
摘要:
public static void main(String[] args) { Thread t1 = new Thread() { public void run() { for (int i = 0; i < 2; i++) { System.out.println(getName() + " 阅读全文