JavaLearning:适配器设计 接口和抽象类

 interface Window{
    public void open();
	public void close();
	public void icon();
	public void unicon();
 };
abstract class WindowAdpater implements Window{
    public void open(){}
	public void close(){}
	public void icon(){}
	public void unicon(){}
};
class MyWindow extends WindowAdpater{
   public void open(){
      System.out.println("open Window");
   }
}
public class Demo026{
    public static void main(String[] args){
	   Window win=new MyWindow();
	   win.open();
	}
}    

你可能感兴趣的:(JAVA)