官网描述 join public final void join() throws InterruptedException Waits for this thread to die. An invocation of this method behaves in exactly the same way as the invocation join(0) Throws: InterruptedException - if any thread has interrupted the curre…
目标线程的join方法暂停当前线程,直到目前线程完成(从run()方法返回). Java代码: package Threads; import java.io.IOException; /** * Created by Frank */ public class Join { public static void main(String[] args) { Thread t = new Thread() { public void run() { System.out.println("Read…