lass Outer
{
private int num=3;
void method()
{
int x=5;
class Inner
{
void show()
{
System.out.println("show run..."+x);
}
}
Inner i = new Inner();
i.show();
}
}
class InnerDemo
{
public static void main(String[] args)
{
//Outer o = new Outer();
//o.method();
//Outer.Inner o = new Outer().new Inner();
new Outer().method();
}
} |
|