On Sat, 12 Mar 2022 09:48:14 GMT, xpbob <[email protected]> wrote:
> * Constructs an empty list with an initial capacity of ten
>
> =>
>
> * Constructs an empty list with default sized empty instances.
>
>
> private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {};
>
> DEFAULTCAPACITY_EMPTY_ELEMENTDATA is empty and the length is 0
Yes that is the point, the backing array does not need to be allocated if there
will be no element. Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7799