public class test
{
public static int a;
public int b;
public static void main(String[] agrs)
{
test t1 = new test();
test t2 = new test();
t1.a = 1;
t2.a = 2;
t1.b = 3;
t2.b = 4;
system.out.println(t1.a + " " t2.a);
system.out.println(t1.b + " " t2.b);
}
}
第一个输出结果都是 2
第二个输出结果是 3和4
你明白为什么的话就说明你懂了