public class k
{
private String name="imooc";
int age=20;
public class inner
{
String name="爱穆课";
public void show()
{
System.out.println("外部类中的name:"+k.this.name);
System.out.println("内部类中的name:"+name);
System.out.println("外部类中的age:"+age);
}
}
public static void main(String[] args)
{
k hello=new k();
inner i=hello.new inner;
i.show();
}
}
相关分类