3 ms·
You can allocate more space than you might need to avoid resizing. It's not uncommon for Java programmers to pass a size when initializing empty array lists, kn
by wcummings 10y ago
You can allocate more space than you might need to avoid resizing. It's not uncommon for Java programmers to pass a size when initializing empty array lists, knowing they will be filled.
- rbehrends 10y agoI am well aware of that, but you often don't have that information.