class Demo_Outer //匿名内部内
{
public static void main(String[] args)
{
Outer o=new Outer();
o.method();
//Outer.Inner oi=new Outer() .new Inner();
// oi.show();
}
}
class Outer{
class Inner{
private void show(){
int num=3;
System.out.println("Hello World!"+num);
}
}
public void method(){
int num1=4;
Inner i=new Inner();
i.show();
}
}
public static void main(String[] args) {
Point pt =new Point();
pt.output();
}
}
|
|