摘要: 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 阅读(41) 评论(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 阅读(92) 评论(0) 推荐(0)
摘要: 1.接口的定义 2.接口的使用 3.面向接口 阅读全文
posted @ 2021-01-20 17:08 Anonymity_Zhang 阅读(80) 评论(0) 推荐(0)
摘要: 代码 // 模板方法模式 举例 public class BankTemplateMethod { public static void main(String[] args) { BankTemplate temp = new DrawMoney(); temp.process(); } } // 阅读全文
posted @ 2021-01-20 17:06 Anonymity_Zhang 阅读(66) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-01-20 17:05 Anonymity_Zhang 阅读(57) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-01-20 17:04 Anonymity_Zhang 阅读(51) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-01-20 17:02 Anonymity_Zhang 阅读(70) 评论(0) 推荐(0)
摘要: //饿汉式 单例模式 class Bank{ //1.私有化类的构造器 private Bank() { } //2.内部创建类的对象 (类的实例) private static Bank bank = new Bank(); //3.提供公共的静态方法 , 返回类的对象 (注 :静态方法中只能调用 阅读全文
posted @ 2021-01-18 17:27 Anonymity_Zhang 阅读(48) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-01-18 17:24 Anonymity_Zhang 阅读(50) 评论(0) 推荐(0)
摘要: 1.包装类的种类 2. 转换图解 3.具体代码 public class JunitTest { //基本数据类型 > 包装类 :装箱 @Test public void test1() { //调用包装类的 构造器 int i =10; Integer int1 = new Integer(i); 阅读全文
posted @ 2021-01-18 13:51 Anonymity_Zhang 阅读(56) 评论(0) 推荐(0)