【单选题】
关于以下程序代码的说明正确的是()
(1) class HasStatic
(2) private static int x=100:
(3) public static void main (String args[]
(4) HasStatic hs1=new Has Static();
(5) hs1.x + +;
(6) Has Static hs2=new HasStatic();
(7) hs2.x + +;
(8) hs1=new HasStatic();
(9) hs1.x + +:
(10) System.out.println("x="+ x);
(11)
(12)
A、5)行不能通过编译,因为引用了私有静态变量
B、10)行不能通过编译,因为x是私有静态变量
C.程序通过编译,输出结果为:x=103
D.程序通过编译,输出结果为:x=100
查看答案解析
参考答案:
正在加载...
答案解析
正在加载...
根据网考网移动考试中心的统计,该试题:
10%的考友选择了A选项
12%的考友选择了B选项
76%的考友选择了C选项
2%的考友选择了D选项