Which one is faster array vs ArrayList

ArrayList is internally backed by Array in Java, any resize operation in ArrayList will slow down performance as it involves creating new Array and copying content from old array to new array.

It is pretty obvious that array[10] is faster than array.get(10), as the later internally
does the same call, but adds the overhead for the function call plus additional checks.

Leave a Reply

Your email address will not be published. Required fields are marked *