关于以下程序代码的说明正确提?
public class ClassTest{
private static int x=100;
public static void main(String args[]) {
ClassTest t1=new ClassTest();
t1.x++; //第5行
ClassTest t2=new ClassTest();
t2.x++;
t1=new ClassTest();
t1.x++;
ClassTest.x--; //第10行
System.out.println("x="+x);
}
}
A 第5行不能通过编译,因为引用了私有静态变量
B 第10行不能通过编译,因为x是私有静态变量
C 程序通过编译,输出结果为:x=103
D 程序通过编译,输出结果为:x=102
public class ClassTest{
private static int x=100;
public static void main(String args[]) {
ClassTest t1=new ClassTest();
t1.x++; //第5行
ClassTest t2=new ClassTest();
t2.x++;
t1=new ClassTest();
t1.x++;
ClassTest.x--; //第10行
System.out.println("x="+x);
}
}
A 第5行不能通过编译,因为引用了私有静态变量
B 第10行不能通过编译,因为x是私有静态变量
C 程序通过编译,输出结果为:x=103
D 程序通过编译,输出结果为:x=102