摘要:
静态代码块、构造器、非静态代码块的执行顺序 执行代码: public class LeafTest { public static void main(String[] args) { Leaf leaf1 = new Leaf(); System.out.println("************ 阅读全文
posted @ 2020-11-22 21:31
CodeKnocker_AQ
阅读(74)
评论(0)
推荐(0)
摘要:
自动装/拆箱和ValueOf陷阱 今天,我们主要通过一道题,简单介绍一下基本数据类型和包装类间的转换的自动装箱和自动拆箱问题,并就该概念下,介绍一下valueOf方法的陷阱,并进行源码解析。 单刀直入,我们直接来看一道题: Integer i1 = new Integer(1);//方式1 Inte 阅读全文
posted @ 2020-11-22 14:02
CodeKnocker_AQ
阅读(86)
评论(0)
推荐(0)