package neibuneidemo; /* * 抽象方法中包含接口 */ public class neibuneidemo { public static void main(String[] args) { //实例化内部接口对象 windows.door wd = new zhuozi().new yizi(); wd.close(); } } //写一个抽象类 abstract class windows{ public abstract void open(); //接口 interface door{ public abstract void close(); } } //写一个子类去继承windows class zhuozi extends windows{ //重写open public void open(){ System.out.println("kai l "); } //实现接口,内部类 class yizi implements door{ public void close(){ System.out.println("guan la"); } } }