为了支持压栈线程与弹栈线程之间的交互与同步,在程序的下划线处依次填入的语句是:   public class IntStack

分类: 2019江中知识赛B(看题模式) 发布时间: 2023-12-01 12:13 浏览量: 0

为了支持压栈线程与弹栈线程之间的交互与同步,在程序的下划线处依次填入的语句是:   public class IntStack{   private int idx=0;   private int[] data=new int[8];   public ______ void push(int i){   data[idx]=i;   idx++;   _____   }   ......   }

A.synchronized() notify()

B.synchronized() this.wait()

C.synchronized() this.notify()

D.synchronized() sleep()

E.C

F.3

正确答案是C