1.适配器模式
将一个接口转换为我们所需要的的接口
2.实例
public interface Adapter { public abstract void test() ; } public class Adaptee implements Adapter{ @Override public void test() { } } public interface Target { public abstract void handler(); } public class TargetImp implements Target{ private Adapter adapter; @Override public void handler() { adapter.test(); } public TargetImp(Adapter adapter) { super(); this.adapter = adapter; } } public class Client { public static void main(String[] args) { Adaptee adaptee = new Adaptee(); TargetImp targetImp = new TargetImp(adaptee); targetImp.handler(); } }