在考生文件夹中存有文件名为 Java_2.java 的文件,该程序是不完整的,请在注释行“ //**********Found********** ”下一行语句的下划线地方填入正确内容,然后删除下划线,请勿删除注释行或改动其他已有语句内容。 存盘时文件必须存放在考生文件夹下,不得改变原有文件的文件名。 本题的要求是: 程序实现了多个代理售票的功能,某次运行结果如下。 Agent A sold one ticket,and 49 tickets left. Agent B sold one ticket,and 48 tickets left. Agent B sold one ticket,and 47 tickets left. Agent A sold one ticket,and 46 tickets left. Agent B sold one ticket,and 45 tickets left. Agent A sold one ticket,and 44 tickets left. Agent B sold one ticket,and 43 tickets left. Agent A sold one ticket,and 42 tickets left. Agent B sold one ticket,and 41 tickets left. Agent A sold one ticket,and 40 tickets left. //*********Found********** public class Java_2 ___________{ static TicketAgent agent; public static void main(String[] args){ agent = new TicketAgent(); Thread t1 = new Java_2 (); Thread t2 = new Java_2 (); t1.setName("Agent A"); t2.setName("Agent B"); t1.start(); t2.start(); } //*********Found********** public void ________( ){ for (int i = 0; i<5; i++){ //*********Found********** ___________(); try{ Thread.sleep(2); }catch(Exception e){} } } } class TicketAgent { //*********Found********** private __________ tickets = 50; public void sell(){ synchronized(this){ if(tickets > 0){ //*********Found********** _________; System.out.print(Thread.currentThread().getName()); System.out.println( " sold one ticket, and " + tickets +" tickets left."); } } } }