3 ms·
The default size of an ArrayList has been 0 for a while. On the first insertion, it is initialized to 10.
by cypressious 3y ago
The default size of an ArrayList has been 0 for a while. On the first insertion, it is initialized to 10.
- alex3305 3y agoThat's a bit semantic, isn't it? Because in practice it's still 10, but lazily initialized [1]. And an empty ArrayList is useless anyway. 1. https://stackoverflow.com/a/34250231 https://stackoverflow.com/a/34250231