java中的线程同步
package com.test; public class Programe { public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub System.out.println("aaaaaa"); System.out.println(args.length); for(String s:args){ System.out.println(s); } //test1(); //test2(); Thread t1=new Thread(){ public void run(){ System.out.println("t1"); } }; Thread t2=new Thread(){ public void run(){ System.out.println("t2"); } }; Thread t3=new Thread(){ public void run(){ System.out.println("t3"); } }; t1.start(); t1.join();//t1执行完成后才会执行t2 t2.start(); t2.join(); t3.start(); }