日期:2014-05-18 浏览次数:20938 次
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("t1...");
}
});
Thread t2 = new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("t2...");
}
});
Thread t3 = new Thread(new Runnable() {
@Override
public void run() {
System.out.println("t3...");
}
});
t1.start();
t1.join();
t2.start();
t2.join();
t3.start();