摘要: public class FactoryTest { public static void main(String[] args) { Car a = new AudiFactory().getCar(); Car b = new BydFactory().getCar(); a.run(); b. 阅读全文
posted @ 2021-01-21 15:48 Anonymity_Zhang 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 1.代理模式的定义 2. 静态代理模式举例 public class NetWorkTest { public static void main(String[] args) { Server server = new Server(); ProxyServer proxyServer = new 阅读全文
posted @ 2021-01-21 11:56 Anonymity_Zhang 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 1.多态的定义 2.多态的使用 //父类 public class Person { String name; int age=18; int id=1001; public void eat() { System.out.println("人 : 吃饭"); } public void walk( 阅读全文
posted @ 2021-01-21 11:52 Anonymity_Zhang 阅读(76) 评论(0) 推荐(0) 编辑