public class SaleTickets implements Runnable { //:定义资源! 100张火车票! private int num = 100; @Override public void run() { while(true) { if(num>0)//:如果有票! System.out.println(Thread.currentThread().getName()+"线程出售的是第"+ num-- +"张火车票!"); } } public static void