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
The comment is correct, it is just that the backing array allocation is delayed
until the first element is added to the list.
Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7799