让三个线程(t1、t2、t3)按顺序依次打印 A、B、C
public class ThreadWait {private static final Object lock = new Object();private static boolean t1Output=true;private static boolean t2Output=false;private static boolean t3Output=false;public static void main(String[] args) {//线程1new Thread(new Runnable(){@Overridepublic void run() {synchronized(lock){for (int i = 0; i < 10; i++) {while(!t1Output){try {lock.wait();} catch (InterruptedException e) {throw new RuntimeException(e);}}System.out.println("t1-->A");t1Output=false;t2Output=true;t3Output