abstract class A
{
public abstract void fun() ;
interface B//内部接口
{
public void print() ;
}
};
class X extends A
{
public void fun()
{
System.out.println("*********") ;
}
class Y implements B
{
public void print()
{
System.out.println("############") ;
}
};
};
public class abstr_inter
{
public static void main(String args[])
{
A a = new X() ;
a.fun() ;
A.B b = new X().new Y() ;
b.print() ;
}
};
interface Window
{
public void open() ;
public void close() ;
public void icon() ;
public void unicon() ;
}
abstract class WindowAdapter implements Window
{
public void open(){} ;//必须有{}
public void close(){} ;
public void icon(){} ;
public void unicon(){} ;
};
class MyWindow extends WindowAdapter
{
public void open()
{
System.out.print("打开窗口") ;
}
};
public class AdapterDemo
{
public static void main(String args[])
{
Window win = new MyWindow() ;
win.open() ;
}
};
interface A
{
public void fun() ;
abstract class B//内部类
{
public abstract void print() ;
}
};
class X implements A
{
public void fun()
{
System.out.println("*********") ;
}
class Y extends B
{
public void print()
{
System.out.println("############") ;
}
};
};
public class Inter_abstr
{
public static void main(String args[])
{
A a = new X() ;
a.fun() ;
A.B b = new X().new Y() ;
b.print() ;
}
};