package com.design.mode.adapter; /** * 接口的适配器模式:当不希望实现一个接口中所有的方法时,可以创建一个抽象类Wrapper,实现所有方法,我们写别的类的时候,继承抽象类即可。 * @author Administrator * */ public class TestAbstractShape { public static void main(String[] args) { Shape source1 = new Shape1(); Shape source2 = new Shape2(); source1.Draw(); source1.Border(); source2.Draw(); source2.Border(); } }

1195584590 LV1
2024年12月20日
快乐的程序员 LV25
2023年1月21日
wangdengzhe LV7
2022年5月7日
莫回头 LV8
2022年5月6日
xiaoquan070 LV2
2022年4月12日
hksrjlx LV1
2022年3月29日
andinker LV10
2022年1月1日
初心不负丶方得始终 LV11
2021年6月22日
color4you LV1
2021年3月23日
new_docker LV15
2020年7月26日

1195584590 LV1
2024年12月20日
chirsbey2
2024年5月10日
暂无贡献等级
jierffff LV2
2023年4月12日
快乐的程序员 LV25
2023年1月21日
kkkkks LV1
2022年12月30日
crosa_Don LV18
2022年7月19日
fanjunzi LV2
2022年5月25日
wangdengzhe LV7
2022年5月7日
xiaoquan070 LV2
2022年4月12日
hksrjlx LV1
2022年3月29日