- 题目:
public class Demo {
static int s;
int i;
int j;
{
int i = 1;
i++;
j++;
s++;
}
public void test() {
j++;
i++;
s++;
}
public static void main(String[] args) {
Demo demo1 = new Demo();
Demo demo2 = new Demo();
demo1.test();
demo1.test();
demo2.test();
System.out.println(demo1.i + "," + demo1.j + "," + demo1.s);
System.out.println(demo2.i + "," + demo2.j + "," + demo2.s);
}
}
结果
2,3,5
1,2,5

被折叠的 条评论
为什么被折叠?



