摘要: public class DemoTest5 { public static void main(String[] args) { int i = 1; String str = "hello"; Integer num = 2; //缓存范围是-128到127 超过缓存范围则存入堆中,没超过就存入 阅读全文
posted @ 2021-11-12 20:19 我叫福禄娃 阅读(57) 评论(0) 推荐(0)
摘要: public class Demotest3 { private int anInt = test(); private static int j = method(); static { System.out.println("1"); } Demotest3(){ System.out.prin 阅读全文
posted @ 2021-11-12 19:54 我叫福禄娃 阅读(129) 评论(1) 推荐(0)
摘要: /** * 标准的饿汉式单例设计模式 */public enum DemoTest { DEMO_TEST("a","b"); private String name; private String age; public String getName() { return name; } publ 阅读全文
posted @ 2021-11-12 19:17 我叫福禄娃 阅读(23) 评论(0) 推荐(0)