题库 软件开发 题目列表 关于以下程序代码的说明正确的是?()    public c...
单选题

关于以下程序代码的说明正确的是?()

   public class HasStatic{

     private static int x=100;

     public static void main(String args[]){

          HasStatic hs1=new HasStatic();

          hs1.x++;

          HasStatic  hs2=new HasStatic();

          hs2.x++;

          hs1=new HasStatic();

          hs1.x++;

        HasStatic.x--;

        System.out.println("x="+x);

     }

   }

A.

程序通过编译,输出结果为:x=103

B.

10行不能通过编译,因为x是私有静态变量

C.

5行不能通过编译,因为引用了私有静态变量

D.

程序通过编译,输出结果为:x=102

题目信息
校招真题
-
正确率
0
评论
15
点击