interface MyInter1{ public abstract void show(); public abstract void show1(); } class OUter{ public void outer(){ //接口引用指向自己的实现类对象,多态调用 MyInter1 M = new MyInter1(){ public void show(){ System.out.println("匿名类对象show"); } public void show1(){ System.out.println("匿名类对象show2"); } }; M.show(); M.show1(); } } public class 内部类 { public static void main(String[] a){ new OUter().outer(); } }