日期:2014-05-20 浏览次数:20666 次
Thread t = new Thread(){ public void run(){ Thread th1 = new Thread(); Thread th2 = new Thread(); Thread th3 = new Thread(); Thread th4 = new Thread(); //这四个线程分别运行5秒 try { th1.start(); th1.join(); th2.start(); th2.join(); th3.start(); th3.join(); th4.start(); th4.join(); } catch (InterruptedException e) { e.printStackTrace(); } } }; t.start();