单选题
Java
题号 #5102289
在堆栈类 SharedStack 的定义中,为了保证堆栈在并发操作中数据的正确性,应在下划线处填入的修饰符是(两个下划线的填写内容相同)

public
不使用修饰符
privat
protected
参考答案
A
答案解析
public 访问控制符指明该类为公共类,可被其他类访问或引用其成员变量和成员方法。为了保证堆栈在并发操作中数据的正确性,必须定义成公共变量。
你可能感兴趣的试题
A.this
A.this
A.this
B.super
B.super
B.super
C.finally
C.finally
C.finally
D.NULL
D.NULL
D.NULL
A.int f=314.;
B.int a=012;
C.int i=189;
D.int d=0x123;
A.int x=3;
A.int x=3;
B.float f;d;
B.float f;d;
C.String S="Hello!";
C.String S="Hello!";
D.boolean b=true;
D.boolean b=true;