/**
* @author zhouushe
*
*/
public interface SoftBank {
public void pay();
}
======================================================================================
package patterns.adapter.adapter2;
/**
* @author zhouushe
*
*/
public class HardBank {
public void zhiFu() {
System.out.println("payment...");
}
}
======================================================================================
package patterns.adapter.adapter2;
/**
* @author zhouushe
*
*/
public class PayAdapter extends HardBank implements SoftBank {
/*
* (non-Javadoc)
*
* @see patterns.adapter.b.SoftBank#pay()
*/
@Override
public void pay() {
super.zhiFu();
}
}
======================================================================================
package patterns.adapter.adapter2;
/**
* @author zhouushe
*
*/
public class Client {
public static void main(String[] args) {
PayAdapter pay = new PayAdapter();
pay.pay();
}
}