package 线程;
class MyThread extends Thread {
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println("*****");
}
}
}
public class JoinDemo {
/**
*
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
MyThread tt = new MyThread();
tt.start();
for (int i = 0; i < 10; i++) {
if (i == 5)
try {
tt.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("+++++");
}
}
}