为了支持压栈线程与弹栈线程之间的交互与同步,在程序的下划线处依次填入的语句是:
public class IntStack{
private int idx=0;
private int[] data=new int[8];
public ______ void push(int i){
data[idx]=i;
idx++;
_____
}
......
}
欢迎免费使用小程序搜题/刷题/查看解析,提升学历,成考自考报名,论文代写、论文查重请加客服微信skr-web
为了支持压栈线程与弹栈线程之间的交互与同步,在程序的下划线处依次填入的语句是:
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()
正确答案C
×
提示:小程序已经收录此题,请在小程序查看名师解析。翰林刷小程序提供搜题,刷题,助你轻松通过考试