int tickets=20;
public void run()...{
while(true)...{
if(tickets>0)...{ 
try...{
Thread.sleep(10); //sleep方法会抛出异常
}catch(Exception e)...{
e.printStackTrace();
}
System.out.println(Thread.currentThread().getName()+" sell ticket "+tickets);
tickets

