4 ms·
The difference between an arraylist with correct initial size and an array is almost nothing. Arraylist itself is just a wrapper around an array.
by sfn42 2y ago
The difference between an arraylist with correct initial size and an array is almost nothing. Arraylist itself is just a wrapper around an array.
- brabel 2y agoIt can be a big difference if boxing is involved. Or if the list is very big, because all access to items in the list require casting at the bytecode level (due to type erasure).