class Outer
{
int num=10;
public void print(final int aArgs)
{
class Inner
{
int num=20;
public Inner()
{
System.out.println("This is Inner.");//此句可看出它与匿名内部类用法的不同。
}
public void print()
{
int num=30;
System.out.println(this); // the object created from the local Inner
System.out.println(num);
System.out.println(this.num);
System.out.println(Outer.this.num);
System.out.println(aArgs);
}
}
Inner inner=new Inner();//此句必须放在定义类Inner的后面
inner.print();
}