//内部类方法中对外部类对象的引用 public class Test { public static void main(String[] args) { // TODO: Add your code here } int x; public class A{ int x; public void aMethod(){ int x; x=3; // x为aMethod方法的局部变量x this.x=4; // x为内部类A的成员变量x this是对A类对象的引用 Test.this.x=5; // x为外部类Test的成员变量x Test.this是对外部类的Test类对象的引用 } } }