摘要:
public class FactoryTest { public static void main(String[] args) { Car a = new AudiFactory().getCar(); Car b = new BydFactory().getCar(); a.run(); b. 阅读全文
摘要:
1.代理模式的定义 2. 静态代理模式举例 public class NetWorkTest { public static void main(String[] args) { Server server = new Server(); ProxyServer proxyServer = new 阅读全文
摘要:
1.多态的定义 2.多态的使用 //父类 public class Person { String name; int age=18; int id=1001; public void eat() { System.out.println("人 : 吃饭"); } public void walk( 阅读全文