超详细JDK1.8 ArrayList集合默认长度及扩容分析
1、首先看ArrayList默认构造方法创建 /** * Shared empty array instance used for default sized empty instances. We * distinguish this from EMPTY_ELEMENTDATA to know how much to inflate when * first element is added. */ private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {};
用户评论