
package com.pln.state;public class TestJoin implements Runnable{@Overridepublic void run() {for (int i = 0; i < 1000; i++) {System.out.println("我要插队啦"+i);}}public static void main(String[] args) throws InterruptedException {TestJoin testJoin = new TestJoin();Thread thread = new Thread(testJoin);thread.start();for (int i = 0; i < 100; i++) {if(i==20){thread.join();//插队}System.out.println("main主方法"+i);}}}
