标签:ring opened png http override 接口 ide 技术 mamicode
1.基本概念
2.代码
package com.chengjie; interface BuySubject { void buy(); } class RealBuySubject implements BuySubject { @Override public void buy() { System.out.println("买一台MAC!"); } } class RealBuySubjectProxy implements BuySubject { private BuySubject bs; public RealBuySubjectProxy(BuySubject bs) { this.bs = bs; } @Override public void buy() { bs.buy(); } } public class TestProxyPattern { public static void main(String[] args) { new RealBuySubjectProxy(new RealBuySubject()).buy(); } }
3.优点
4.缺点
5.应用场景
6.参考
https://www.jianshu.com/p/a8aa6851e09e
标签:ring opened png http override 接口 ide 技术 mamicode
原文地址:https://www.cnblogs.com/forTheDream1991/p/10445216.html