public class TestCat {
int a;
int b = 1;
int c = 3;
public static void main(String[] args) {
TestCat d = new TestCat(1);
d.m(d);
}
TestCat(int a) {
this.a = a;
b = c++;
}void m(TestCat c) {
int a = 10;
System.out.println(b);
System.out.println(this.b);//在这里输出b没有发生错误,下面输出C时出错了!!
System.out.println(c);//为什么在这里不能正确打印出C的值,而是输出:TestCat@de6ced
System.out.println(this.c);//加了this.正确输出C 的值 4 ,想问一下跟上面有什么区别??
System.out.println(a + " " + b + " " + c);
System.out.println(this.a + " " + b + " " + c);
System.out.println(a + " " + b + " " + this.c);
System.out.println(a + " " + b + " " + this.c);
System.out.println(c.a + " " + c.b + " " + c.c);
}
}