class Outer
{
int outer1=100;
void test()
{
Inner in=new Inner(this);
in.display();
}
public static void main(String[] args)
{
Outer outer=new Outer();
outer.test();
}
}
class Inner
{
Outer outer;
public Inner(Outer outer)
{
this.outer=outer;
}
void display()
{
System.out.println("outer1="+outer.outer1);
}
}
Inner in=new Inner(this);中的this到底指的是什么? |
|