发布时间:2014-05-07 23:32:47
通过java多线程模拟火车售票,开始的错误程序//售票类class Runner implements Runnable{private int Ticketnum=10;int id;Runner(int id){this.id=id;}synchronized void SellTic(){if(Ticketnum<=0){return;}else {System.out.println(Thread.currentThread().getName()+" sale "+Ticketnum--);}}public .........【阅读全文】