@@ -0,0 +1,1743 @@
+package com.niux.springmvcdemo.threadSync;%0A%0Apublic class JoinTestDemo %7B%0A    public static void main(String%5B%5D args) %7B%0A        String threadName = Thread.currentThread().getName();%0A        System.out.println(threadName + %22 start.%22);%0A        CustomThread1 t1 = new CustomThread1();%0A        CustomThread t = new CustomThread(t1);%0A        try %7B%0A            t1.start();%0A            Thread.sleep(2000);%0A            t.start();%0A            t.join();//%E5%9C%A8%E4%BB%A3%E7%A2%BC2%E9%87%8C%EF%BC%8C%E5%B0%87%E6%AD%A4%E8%99%95%E6%B3%A8%E9%87%8B%E6%8E%89%0A        %7D catch (Exception e) %7B%0A            System.out.println(%22Exception from main%22);%0A        %7D%0A        System.out.println(threadName + %22 end!%22);%0A    %7D%0A%7D%0A%0A%0Aclass CustomThread1 extends Thread %7B%0A%0A    public CustomThread1() %7B%0A        super(%22%5BCustomThread1%5D Thread%22);%0A    %7D%0A%0A%0A    public void run() %7B%0A        String threadName = Thread.currentThread().getName();%0A        System.out.println(threadName + %22 start.%22);%0A        try %7B%0A            for (int i = 0; i %3C 5; i++) %7B%0A                System.out.println(threadName + %22 loop at %22 + i);%0A                Thread.sleep(1000);%0A            %7D%0A            System.out.println(threadName + %22 end.%22);%0A        %7D catch (Exception e) %7B%0A            System.out.println(%22Exception from %22 + threadName + %22.run%22);%0A        %7D%0A    %7D%0A%0A%7D%0A%0Aclass CustomThread extends Thread %7B%0A%0A    CustomThread1 t1;%0A%0A    public CustomThread(CustomThread1 t1) %7B%0A        super(%22%5BCustomThread%5D Thread%22);%0A        this.t1 = t1;%0A    %7D%0A%0A    public void run() %7B%0A        String threadName = Thread.currentThread().getName();%0A        System.out.println(threadName + %22 start.%22);%0A        try %7B%0A            t1.join();%0A            System.out.println(threadName + %22 end.%22);%0A        %7D catch (Exception e) %7B%0A            System.out.println(%22Exception from %22 + threadName + %22.run%22);%0A        %7D%0A    %7D%0A%0A%7D%0A

test join =>等待一个线程执行完毕