标签:void 控制 ima ges class null als ring 技术分享
参考文章
代理模式(Proxy):为其他对象提供一种代理以控制对这个对象的访问。
abstract class Subject{ public abstract void request(); } class RealSubject extends Subject{ public void request() { System.out.println("This is real subject."); } } class Proxy extends Subject{ private Subject subject = null; public Proxy(Subject subject) { this.subject = subject; } public void request() { System.out.println("Proxy calls real subject."); subject.request(); } } public class StaticProxyTest { public static void main(String[] args) { Subject proxy = new Proxy(new RealSubject()); proxy.request(); } }
标签:void 控制 ima ges class null als ring 技术分享
原文地址:http://www.cnblogs.com/anxiao/p/7305946.html