想知道其中a的值为什么是10,而不是0,this语句调用的不是成员变量吗?
public class OOExample {
private int a;
public void setA(int a)
{
this.a = a;
}
public int add(int b)
{
return this.a + b;
}
public static void main(String[] a)
{
int b = 5;
OOExample obj = new OOExample();
obj.setA(10);
System.out.println(obj.add(b));
}
}