[求助]this关键字问题
public class Group{
private static int count;
private String name;
public class Student
{
private int count;
private String name;
public void output(int count)
{
count++;
this.count++;
Group.count++;
Group.this.count++;//谁能解释一下这条语句--这里的this指的是哪个对象(实例)?
System.out.println(count+" "+this.count+" "+Group.count+" "+Group.this.count);
}
}
public Student aStu()
{
return new Student();
}
public static void main(String [] args)
{
Group g=new Group();
g.count=10;
Group.Student s=g.aStu();
s.output(5);
}
}
Group.this.count++;//谁能解释一下这条语句--这里的this指的是哪个对象(实例)?
Group.count++; //这两句有什么区别? 谢谢
Group.this.count++;