public class app
{
public static void main(String[] args)
{
Tickets t=new Tickets(10);
new Producer(t).start();
new Consumer(t).start();
}
}
class Tickets
{
protected int size ;
int number=0;
boolean available= false
用两个线程模拟存票、售票过程
最新推荐文章于 2023-04-07 21:07:16 发布