码迷,mamicode.com
首页 > 其他好文 > 详细

适配器模式

时间:2019-09-27 15:19:46      阅读:60      评论:0      收藏:0      [点我收藏+]

标签:不同   string   col   mic   技术   mamicode   inf   一起   alt   

 

技术图片

 

 

public class Test {

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

}

 

 

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

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

 

适配器模式

标签:不同   string   col   mic   技术   mamicode   inf   一起   alt   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!