适配器模式

public class Test {

    public static void main(String[] args) {
        Target target = new Adapter();
        target.Request();
    }

}

适配器模式:将一个类的接口转换成客户希望的另外一个接口。Adapter模式使得原本犹豫接口不兼容而不能一起工作的那些类可以一起工作。

两个类所做的事情相同或相似,但是具有不同的接口时要使用它

原文地址:https://www.cnblogs.com/SasaL/p/11597935.html