本帖最后由 lucy198921 于 2013-3-30 21:23 编辑
运行正常,但是就是没有运行出结果.
interface Inter
{
public abstract void show();
public abstract void show1();
}
class Outer
{
public void method()
{
Inter i= new Inter()
{
public void show()
{
System.out.println("inner...show");
}
public void show1()
{
System.out.println("inner...show1");
}
};
i.show();
i.show1();
}
}
class Demo
{
public void abc()
{
System.out.println("demo....abc");
}
}
class AnonymousDemo4
{
public static void main(String[] args)
{
Object obj=new Object()
{
public void abc()
{
System.out.println("zilei.....abc");
}
};
}
}
|