摘要: 适配器在生活中是一种很常见的一种东西,在国内买个手机欧版手机,充电器的插头和国内的插座不匹配,商家会为你提供一个转接头来适配,方能正常使用。中间的转接口就可看做是适配器。适配器模式就是类似的一个过程。充电器是说明适配器模式的一个常用的例子,在此我也来借鉴一下。将欧式插头转到中式 1 package com.cnblogs.ipolaris.adapter.test; 2 3 public class CPlug { 4 public String adapterSocket(){ 5 System. out .println("我是中式插头" );... 阅读全文
posted @ 2012-09-12 00:09 iPolaris 阅读(251) 评论(0) 推荐(0)